Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

Angular Error: ERROR TypeError: Cannot read properties of undefined (reading 'title')

04.02.2023 (👁3262)


Falscher Code:

<p>read article: {{idarticle}}</p>

<div  >

    <h1>Title: {{article.title}}</h1>

    <div><a href="/edit/{{article.idarticle}}" title="edit {{article.title}}" class="link_item">edit</a>

</div>

</div>

 

Lösung Code

Man sollte eine bedingte Anzeige mit *ngIf umbauen

<div *ngIf="article">

 

    <p>read article: {{idarticle}}</p>

    <div>

        <h1>Title: {{article.title}}</h1>

        <div><a href="/edit/{{article.idarticle}}" title="edit {{article.title}}" class="link_item">edit</a>

        </div>

    </div>

</div>

 

 

Ein Bild, das Text, Computer, Screenshot, drinnen enthält.

Automatisch generierte Beschreibung

Fehlermeldung

ERROR TypeError: Cannot read properties of undefined (reading 'title')

    at ReadArticleComponent_Template (read-article.component.html:4:9)

    at executeTemplate (core.mjs:10534:9)

    at refreshView (core.mjs:10419:13)

    at refreshComponent (core.mjs:11480:13)

    at refreshChildComponents (core.mjs:10210:9)

    at refreshView (core.mjs:10469:13)

    at refreshEmbeddedViews (core.mjs:11434:17)

    at refreshView (core.mjs:10443:9)

    at refreshComponent (core.mjs:11480:13)

    at refreshChildComponents (core.mjs:10210:9)