We are looking for the best solution, here is my current solution:
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); } }
Alex Paramonov Nov 05 '16 at 13:32 2016-11-05 13:32
source share