79113788

Date: 2024-10-22 11:25:05
Score: 2
Natty:
Report link

the answer is ViewEncapsulation.Emulated

Options for handling it:

  1. 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.

  2. Global Styling (if needed): If you want to target this from a global stylesheet (though not generally recommended unless necessary), you can:

  3. Use ViewEncapsulation Options:

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

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • User mentioned (1): @Component
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: neel upadhyay