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

1.1k Views Asked by At

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!

1

There are 1 best solutions below

1
On

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.