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

blur event not working ngModel #127

Open m-saifuddin opened 6 years ago

m-saifuddin commented 6 years ago

I am using below code to catch blur event.

<ngx-select  class="custom-select" [allowClear]="true" (blur)="validateTopic(EMIRATE)" (change)="validateTopic(EMIRATE)" [items]="emiratesList"  #EMIRATE="ngModel" [class.is-invalid]="topicHasError && EMIRATE.touched" name="EMIRATE" [(ngModel)]="model.EMIRATE">
                  </ngx-select>

and below code in

export class CoverComponent implements OnInit {
constructor(){ }
 validateTopic(value) {
        console.log(value);
        if (value === 'default') {
            this.topicHasError = true;
        } else {
            this.topicHasError = false;
        }
    }
}

but its not firing event.

Any help would be highly appreciated.

Thanks,

optimistex commented 6 years ago

@m-saifuddin Please, make a fork of https://stackblitz.com/edit/ngx-select-ex-issues-100 And reproduce the error to save my time. As soon as I will see it I'll try to fix it. Thanks!