s.stkvc
s.stkvc

Reputation: 147

get rid of _nghost and _ngcontent in chrome dev tools html view encapsulation

I am currently working on a already existing angular project - upon expecting the html page via google dev tools I found some weird additions to the html - like _nghost... and _ngcontent...

enter image description here

How do I get rid of those props? Ive never seen them in other projects.

I already found out, that it may have something to do with ViewEncapsulation in Angular, therefore I changed my tsconfig.json file so it includes the following statement:

enter image description here

Sadly no changes ... Thanks in advance for your help!

Upvotes: 1

Views: 1576

Answers (1)

E1dar
E1dar

Reputation: 622

Add ViewEncapsulation.None, like that:

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: [ './app.component.scss' ],
    encapsulation: ViewEncapsulation.None
})

But in that case you need to work with styles specificity by yourself.

Upvotes: 2

Related Questions