How to add a specific class to a nav bar based on its component using angular 5
Basically, I'm trying to create an Angular 5 App. Now in this app, I've multiple components like HomeComponent
, AboutComponent
, ContactComponent
. Now I want my nav bar's background completely transparent in the Home Component but black in other components.
I'm using bootstrap 4 also in this project. So in other components, I just want to add bg-primary
class to my navbar and in the home component, I just want to remove that class and some CSS styles.
how can I achieve it?
Here is the code for my nav bar
<nav class="navbar navbar-expand-lg navbar-dark text-uppercase bg-primary w-100 position-fixed">
........
.......
</nav>