toggle the background image of a whole page in angular 4

I am building an Angular 4 app. I want to show a background image based on whether a user is logged in or not. If a user is not logged in, I want the background image to be shown on the home page. If not logged in, it shouldn't be shown.

What are the ways to achieve this?

Thank You.