How to apply CSS to a child component html that is used in the angular project via 3rd party NPM module?


April 2019


7 time


I have included a 3rd party pagination module for my angular application. It is working perfectly except that it does have some html that I don't want on my view. I tried to hide that mark-up by applying display: none !important; CSS property but it did not work so I had to pass

encapsulation: ViewEncapsulation.None

to my component decorator and it started working. Only problem I have with this approach is when I route away from the current component. It messes up with the button styles of my dashboard component. This problem also goes away on dashboard if either I reload the page or navigate to another route.

Is there any decent solution to this?

0 answers