Still looking for a better solution, here is my current workaround:
import { Component, OnInit, OnDestroy, ViewEncapsulation } from '@angular/core';
@Component({
selector: 'signup',
templateUrl: './signup.component.html',
styleUrls: ['./signup.component.css',], // Where my custom CSS styles for body element declared
encapsulation: ViewEncapsulation.None, // That will not encapsulate my CSS styles (layout-full, page-signup) from signup.component.css inside component
})
export class SignupComponent implements OnInit, OnDestroy{
bodyClasses:string = "layout-full page-signup";
ngOnInit(): void {
$('body').addClass(this.bodyClasses);
}
ngOnDestroy() {
$('body').removeClass(this.bodyClasses);
}
}