DEV Community

Discussion on: Mastering Angular 8: five things that are good to know to save your time.

Collapse
 
coly010 profile image
Colum Ferry

Great article, just a quick comment to say that we shouldn't be encouraging people to use ::ng-deep as it's been deprecated.
Instead, if your style must live outside view encapsulation of your component, consider setting the ViewEncapsulation of your component to None, or placing the style in a global stylesheet.

Link to Angular Docs for reference:
angular.io/guide/component-styles#...

Collapse
 
marchofprogress profile image
Erik O.

There are several components on NPM (github) to use but most have default encapsulation so ng-deep is very useful. Be aware of the next :

If the ::ng-deep combinator is used without the :host pseudo-class selector, the style can bleed into other components.

Collapse
 
oleksandr profile image
Oleksandr

Thanks for sharing!