For my navigation bar, the li is given the class of "active" (using routerLinkActive) if that is the current page. This is fine if I know what the colour is in order to style the "active" class. However how do I approach this if I need to style the "active" li with inline styles? I have an html colour coming in from an api so this is why I need to put it inline. Currently I have:
<li routerLinkActive="active"><a [routerLink]="['/blah']">Blah</a></li>
Which just works with the preset defined ".active" class. How can I do something like the below which will style it with inline styles?
<li routerLinkActive="active" [ngStyle]="if active{{'color': color}}"><a [routerLink]="['/blah']">Blah</a></li>
Thanks for everyones help so far but the suggested post wouldn't be able to help me since using routerLinkActive isn't really an active variable to work within the typescript ecosystem.