angularangular-ngselecttyped

ng-2 select (typed) not working properly is there a fix ?


I am using ng-select (typed) property which is bind to an event which goes to server when the input is longer then 3 characters . The problem is that when the event is triggered nothing happens , I need to manualy delete input text in order to see the data that came ... Is there a work around to this problem ,which would list the items when they come back from server instantly without any user actions ?


Solution

  • i think you may need to use a trigger in right life cycle hook first call ngAfterViewInit() and after you may call it on ngOnChanges()

    comboTrigger: Subject<any> = new Subject();
    

    in method where your service call you can trigger

    this.dtTrigger.next();