I need to provide select UI element with dynamic options for which I have a method that returns an observable based on the Inputs
TypeScript (Component class)
getCars(type : string, engine : string) : Observable<Cars>{
return this.carService.getCars(type,engine);
}
In the HTML I make my element call this method for data
Html (Template file)
<ng-select [items]="getCars(type,engine) | async"
bindLabel="value"
bindValue="id"
</ng-select>
but this results in service being called infinitely. I do not want to use ngOnInit as I need the observable to be dynamically assigned
I'm using this UI element for select