I am working with 3 buttons that loop through a list of links
links = [
{
name: "Link 1",
id: "number1"
},
{
name: 'Link 2',
id: "number2"
}
{
name: "Link 3",
id: "number3"
}
]
These buttons generate 3 buttons in HTML.
In addition, I have a DIV looping through items in "number1":
number1 = [
{
name: 'IT',
address: 'Tokyo 4',
},
{
name: 'Computer',
address: 'Tokyo 4',
},
{
name: 'Garden',
address: 'Tokyo 4',
},
{
name: 'Cars',
address: 'Tokyo 4',
}
]
The DIV renders H1 with {{ card.name }}
and P with {{ card.address }}
Now, I need to switch from looping through "number1" to then looping through "number2" when the button number 2 is clicked. How can I achieve this?
(click)="change number1 to number2" - when I click button number 2 etc
Here's the PLUNKER link for reference: https://plnkr.co/edit/MfSx9MjoVtHprFtBHKDZ?p=preview