What is the difference between ViewEncapsulation.None and :host, :host /deep/?

4.1k Views Asked by At

I have an Angular 6 custom form control which I have created as a wrapper around another control so that we can apply our own css rules.

I have removed the ViewEncapsulation on this wrapper component so that we can hook on to the css classes generated by the existing form control and overwrite the rules.

encapsulation: ViewEncapsulation.None

A reviewer suggested me to use the combination of :host and :host::ng-deep rather than using ViewEncapsulation.None.

I don't know why that could be better. Can someone explain?

0

There are 0 best solutions below