Diff between ViewEncapsulation.Native, ViewEncapsulation.None and ViewEncapsulation.Emulated

后端 未结 6 1104
猫巷女王i
猫巷女王i 2020-12-07 16:49

Can some one explain what\'s the difference between ViewEncapsulation.Native, ViewEncapsulation.None and ViewEncapsulation.Emulated

6条回答
  •  生来不讨喜
    2020-12-07 17:29

    If anyone's getting to this question because they want to style child components via parent component style declarations, see this SO answer.

    However, as the latest comment on the accepted answer indicates, the Angular docs say:

    The shadow-piercing descendant combinator is deprecated and support is being removed from major browsers and tools. As such we plan to drop support in Angular (for all 3 of /deep/, >>> and ::ng-deep). Until then ::ng-deep should be preferred for a broader compatibility with the tools.

提交回复
热议问题