8000 /deep/, >>>, and ::ng-deep will be deprecated. Any alternative? · Issue #29765 · angular/angular · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/deep/, >>>, and ::ng-deep will be deprecated. Any alternative? #29765
Closed
@najafi-saeed

Description

@najafi-saeed

As docs say /deep/, >>>, and ::ng-deep will be deprecated, so what's the alternative?

Here is the problem:
I have a component.

<app-mycomp>
    <h2>Some Text...</h2>
</app-mycomp>

mycomp.component.html:

<div class="title">
    <ng-content></ng-content>
</div>

I need to style h2 in mycomp.component.css (not in other files)

h2{ margin: 0px;}

But it is not working because of encapsulation, so I used ::ng-deep:

::ng-deep h2{margin: 0px;}

but the docs say ::ng-deep will be deprecated. what's the alternative?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0