Angular nested components undefined (reading 'ɵcmp')

Discussão em 'Angular' iniciado por rnwcode, Dezembro 12, 2024.

  1. rnwcode

    rnwcode Guest

    I have a component that integrates another component depending on the content. The child component calls the parent component again as content.

    Unfortunately I get the following error message and I don't know how to fix it:

    main.ts:5 ERROR TypeError: Cannot read properties of undefined (reading 'ɵcmp')

    The structure looks like this:

    • Content renderer
      • Content-Renderer-Type Headline
        • Content renderer
          • Content-Renderer.Type Text
      • Content-Renderer-Type Paragraph
        • Content-Renderer
          • Content-Renderer.Type Text

    Renderer-Component:

    <span *ngFor="let c of content">
    <app-content-headline *ngIf="c.type === 'heading'" [content]="c"></app-content-headline>
    <app-content-paragraph *ngIf="c.type === 'paragraph'" [content]="c"></app-content-paragraph>
    <app-content-list *ngIf="c.type === 'list'" [content]="c"></app-content-list>
    <app-content-text *ngIf="c.type === 'text'" [content]="c"></app-content-text>
    </span>


    Child-Component:

    <p>
    <app-content-renderer *ngIf="content.children" [content]="content.children" />
    </p>

    Continue reading...

Compartilhe esta Página