I don't know how to set css style for :host {} in ngOnInit in component. Can use Renderer to set this?
Example:
<app-a *ngFor ="let a in alist" [a] = "a"></app-a>
In ngOnInit app-a i wanna to set width height style by percent for :host of app-a component when in rendered by ngFor?
Can I do it?
Many Thanks.
@Component({ styles: [...], styleUrls: [...]}). You can set/remove classes or attributes inngOnInit()to make different parts of your styles apply depending on these classes or attributes.