Answer the question
In order to leave comments, you need to log in
How to set a style for a component that will depend on the active route?
Hello. The second month I delve into Angular. I ran into a problem the other day. Essence: there is an application, the main structure is as follows:
- header with several routes (links)
- router-outlet
- footer
Main route - /home. There are also 4 more sections.
It is necessary that the header when opening /home be transparent, on all other sections it is white.
I can't figure out how to implement this. I tried directives, tried to do something through routerState (such a hobby), decorators, in general, nothing. Prompt those who know how to implement it, at least approximately. Again, I am a beginner and may have chosen the right method, but I screwed up.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question