Reputation: 2719
I select daemon value (place, name or thing) and each of this daemon have dedicated productlist ( once again a drop down). I have replicated this in stackblitz here stackblitz of code what I tried.
What I am not able to do is update the second dropdown based on the value of daemon selected.
Upvotes: 0
Views: 857
Reputation: 41543
Modify your selectDaemon
function as below
selectDaemon(value){
console.log("daemon selected"+value);
this.globalValueDaemon = value;
let selectedProductList = this.stateGroups.find(item=>item.daemon==value).productlist;
this.productGroupOptions=of(selectedProductList)
}
Add the import for the of
operator as
import {Observable,of} from 'rxjs';
and remove the assignment to this.productGroupOptions
from ngOnInit()
Upvotes: 2