0

I am trying to make an Agular app, and I want certain components to have certain background images. So I tried in the .ts files

encapsulation: ViewEncapsulation.None

And in the .scss file

body { background-image:url (...) }

The problem is that when I move from one page to another the background of the first page is on the second one until I hit refresh. ( I tried to put !important also :D)

Thanks for your time!

Andrei
  • 1
  • `encapsulation: ViewEncapsulation.None` makes your component CSS global. Do not change the style of `body` from components, it will become maintenance headache. – Prajwal Aug 26 '21 at 11:48
  • I understand that now, but I asked how can I change background-images without it:d – Andrei Aug 27 '21 at 05:21
  • 1
    @Andrei Remove `encapsulation` to get rid of the problem and to change the background image of `body` read [this answer](https://stackoverflow.com/a/43552385/11719787) – Sameer Aug 27 '21 at 05:29

0 Answers0