It seems while using the angular project I wanted to hide style .navmenu [_ngcontent-ng-c3021713184] whenever I run a project so the question is how to hide [_ngcontent-ng-c3021713184] This one so any one have a best answer for this?
It seems while using the angular project I wanted to hide style .navmenu [_ngcontent-ng-c3021713184] whenever I run a project so the question is how to hide [_ngcontent-ng-c3021713184] This one so any one have a best answer for this?
2
Answers
the answer is ViewEncapsulation.Emulated
Options for handling it:
Direct Component Styling: You can write styles in the component's own CSS file without worrying about the _ngcontent-* attribute, as Angular automatically handles that for encapsulation.
Global Styling (if needed): If you want to target this from a global stylesheet (though not generally recommended unless necessary), you can:
Use ViewEncapsulation Options:
@Component({ selector: 'app-navmenu', templateUrl: './navmenu.component.html', styleUrls: ['./navmenu.component.css'], encapsulation: ViewEncapsulation.None })
encapsulation: ViewEncapsulation.None,
should do that trick.
For more, have a look at https://v17.angular.io/guide/view-encapsulation.