I have this array of objects:
myList = [
{ name: 'line', icon:'line-chart' },
{ name : 'spline', icon: 'spline-chart' },
{ name : 'bar', icon: 'bar-chart' }
];
Each of these objects represents a button. When that button is clicked it should activate that type of chart.
Another functionality that I must create is that each of these buttons when it is clicked, it activates (or deactivates) other buttons.
For example, line button must activate 3 other buttons while, spline and bar must activate only one each.
line - single, double, triple
spline - single
bar - triple
The set of secondary buttons is this:
mySecondList = [
{ name: 'Single', icon:'a' },
{ name : 'Double', icon: 'b' },
{ name : 'Triple', icon: 'c' }
];
My problem comes here when I want to make a connection between these two.
I tried to incorporate the second array into the first one like this:
myList = [
{ name: 'line', icon:'line-chart', [{ name: 'Single', icon:'a' }, { name : 'Double', icon: 'b' }, { name : 'Triple', icon: 'c' }] },
{ name : 'spline', icon: 'spline-chart', [{ name: 'Single', icon:'a' }] },
{ name : 'bar', icon: 'bar-chart', [{ name: 'Single', icon:'a' }] }
];
but it seems it's not the correct way.
Any suggestions?