SlimSelect + Angular 6

0

Hello, this is the first time I use SlimSelect and I'm having trouble making it work.

I created a test-only component called 'AddConta' and in its method 'ngOnInit ()', I put what the SlimSelect documentation requested. Exactly as the picture below shows:

AndinmyHTMLIcreatedtheselectasshownbelow:

But I'm getting the following error:

ERROR ERROR: Could not find select element

Does anyone know how to help me? Thanks in advance ...

    
asked by anonymous 04.01.2019 / 01:44

1 answer

1

I do not know if it was able to solve, but it was not necessary to put the element's definer, in this case 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'
    })
  }
}
    
07.01.2019 / 19:58