optimistex / ngx-select-ex

Angular based replacement for select boxes
https://optimistex.github.io/ngx-select-ex/
MIT License
111 stars 42 forks source link

filling ngx-select-ex using enum #151

Open erickvls opened 5 years ago

erickvls commented 5 years ago

How can i filling my select using enum in my component? I can see my enum with the strings but i cant get the value.

This is my select using enum in html link.

This is my enum in my component.ts link

in my component in onInit i have this for fill my select in html `export class MyComponent{

orientacaoSexual: string[];

ngOnInit(): void {
    var orientacaoSexual = Object.keys(OrientacaoSexual);
    this.orientacaoSexual = orientacaoSexual.slice(orientacaoSexual.length / 2);`

and in my html page i have

<ngx-select (selectionChanges)="parseValue($event.target.value)" placeholder="Selecione o Estado" [items]="orientacaoSexual" optionValueField="orientacaoSexual"></ngx-select>

and when i click in any select option i get this error. link