0
How do, in angular 7, a background-color of the body different from the page I’m displaying?
Example:
- Login page: green background
- Home: blue background
0
How do, in angular 7, a background-color of the body different from the page I’m displaying?
Example:
-1
You can do this from any of its components. For example:
export class AppComponent implements AfterViewInit {
constructor(private elementRef: ElementRef){
}
ngAfterViewInit(){
this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor = 'yourColor';
}
}
Browser other questions tagged html css angular scss angular-7
You are not signed in. Login or sign up in order to post.