Is there a way to add a class from the .ts file, using Angular solutions
I want to d
While the solution with the Renderer works, I am proposing you create a data structure for your buttons
buttons: Array<{label: string}> = [
{
label: 'Global'
},
{
label: 'Maintenance'
},
{
label: 'Settings'
},
{
label: 'Profile'
},
{
label: 'Transactions'
}
]
This can easily be iterated through using ngFor
And only thing your ChangeScreen
method would need is... the thing its already doing, setting the current page!
See stackblitz for an example of how this plays out.