Slimselect + Angular 6

Asked

Viewed 41 times

0

Hi, this is the first time I use Slimselect and I’m having trouble making it work.

I created a test-only Component called 'Addaccount' and in its 'ngOnInit()' method, I put what the Slimselect documentation asked for. Exactly as the photo below shows:

inserir a descrição da imagem aqui

And in my HTML I created select as shown below:

inserir a descrição da imagem aqui

But I’m getting the following error:

ERROR Error: Could not find select element

Can anyone help me? Thank you in advance...

1 answer

1


I do not know if it could solve, but it lacked to put the definitor of the element, in the case there a id #.

import { Component, OnInit } from '@angular/core';
import SlimSelect from 'slim-select';

@Component({
  selector: 'add-conta',
  templateUrl: './add.conta.html',
  styleUrls: ['./add.conta.css']
})

export class addConta implements OnInit {

  ngOnInit(): void {
    new SlimSelect({
      select: '#single'
    })
  }
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.