Error: 'app-header' is not a known element despite adding 'CUSTOM_ELEMENTS_SCHEMA'

Discussão em 'Angular' iniciado por Mannu, Setembro 12, 2024.

  1. Mannu

    Mannu Guest

    Even though the 'app-header' component is being rendered in the browser, the content in the corresponding "header.component.ts" or "header.component.html" is not being displayed.

    [​IMG]

    error: 'app-header' is not a known element:
    If 'app-header' is an Angular component, then verify that it is part of this module.
    If 'app-header' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.ngtsc(-998001)


    Here's what I've tried so far:

    • I have verified that 'app-header' is indeed part of the module.
    • I have added 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of the module to suppress the error.

    My goal is to resolve this issue and ensure that the content in 'app-header' is displayed as expected ("header works").

    Continue reading...

Compartilhe esta Página