0

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 ?

1 Answers1

1

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();
H-a-Neo
  • 152
  • 7
  • It would be easy if i could pull all the products at once and then filter them like it should be done , but the point of this --on 3rd input character request-- is to loosen up the back , because at one point there will be like more then 50 000 products and i can't pull them every time , the problem is a little glitch in ng-select that doesn't list out the products when they arrive , which can confuse the user . – Алекса Јевтић Jan 19 '18 at 18:11
  • well that happen to me also puling out customers trial calculation List. i almost had 12 mil record in the db . all i did is make a service will give away 10 records (no of records display on select when it expands). then track the select's scroll and load another 10 or so. even if customer request a filter using n no of chars then i only bring 10 records . this will remove the glitch you were talking .cus every time service call made for 10 records and it';s very fast wont event notice the glitch – H-a-Neo Jan 19 '18 at 19:44