two multiselect interaction

UI Components for Angular
Post Reply
iaminsertname
Posts: 1
Joined: 17 Jun 2019, 15:09

17 Jun 2019, 15:16

Hello
I have two multiselects one for car brands the other for models.
When user picks the brands the options for the models multiselect are updated.

Im using a getter for this to happen

get brandModels(): SelectItem[] {
var modelsArray = [];
if (this.selectedBrands && this.selectedBrands.length > 0)
this.fullBrandModel
.filter(ab => this.selectedBrands.indexOf(ab.id) > -1)
.forEach(i => { i.models.forEach(m => modelsArray.push(m)) });
return modelsArray
.map(i => { return { label: i.name, value: i.id } });
}

Now finally the question:)
How can i get the value of the input of the brands multiselect in the brandModels getter so i fix my getter to return filtered results

Thank you!

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 33 guests