I need to dynamically set the background image. Since ion-content
is an element how can I do that? If it is a css class then I can do like so
[class]="cssClassName"
and I can change the class name inside the ts
file. But here how can I do that?
.ts
ngOnInit() { this.init(); }
init() {
switch (environment.hotelEnvironment.hotelName) {
case "com1":
// has back ground
break;
case "com2":
//no back ground
break;
default:
}
}
.html
<ion-content>
</ion-content>
.scss
ion-content {
--background: url('/assets/img/com/background/background.png') no-repeat 100% 100%;
}