Required to dynamically call to Change() event on page load in Angular 8.3.21 and ng-select

Discussão em 'Angular' iniciado por GM_9, Janeiro 29, 2025.

  1. GM_9

    GM_9 Guest

    I'm unable to call the change() event when the page gets loaded.

    I would like to display 'NONE' as a default text in ng-select drop-down untill api data gets loaded; thus, the 'NONE' value will be sent in request object while submitting its form. Anyhow, due to change event not getting fired on page load, I'm unable to proceed further.

    \<ng-select \[items\]="apidata | async" bindValue="name" bindLabel="name" #refOption
    (change)="onChangeMethod()"\>
    \</ng-select\>


    Technical specifications of <ng-select> control

    • ng-select : "3.7.2"
    • @angular/cli : "~8.3.21"

    Note

    1. I had tried with adding Virwchild to call respective drop-down value but no luck.
    2. Tried code inside ngAfterViewInit()

    Continue reading...

Compartilhe esta Página