Answer the question
In order to leave comments, you need to log in
Angular, is it possible to filter by radiobutton?
Hello.
There is some model like
{
Items: [{Name:"First", Categories:[1,2]},
{Name:"Second", Categories:[1]},
{Name:"Cats", Categories:[2,3]},
{Name:"Dogs", Categories:[3]}//итд
],
Categories:[{Id:1, Name:"SomeItems"},
{Id:2, Name: "SomeItems2"},
{Id:3, Name: "Anything"//итд
]}
Answer the question
In order to leave comments, you need to log in
It seems that it is possible to propagate radio buttons using *ngFor="#btn of buttons"
, by hanging on the button selection event a call to the rButtonSelected(#btn.Categories)
component method that will change the array field of the component showingCategories
. And the category display block will use the same *ngFor="#c of showingCategories"
to display the current displayed categories.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question