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: InnerHTML Text-String to HTML Output

01.04.2021 (👁739)

Angular: InnerHTML

Wie erzeugt man in Angular HTML von Text-String zu HTML ?

Lösung:

<div [innerHTML]='article?.htmlcontent'></div>

 

 

Error if wrong:

compiler.js:2175 Uncaught Error: Template parse errors:

Parser Error: Unexpected token 'is' at column 6 in [this is innerhtml] in ng:///AppModule/ReadArticleComponent.html@17:18 ("

<div [innerHTML]="[ERROR ->]this is innerhtml"></div>

 

 

Wrong:

<div [innerHTML]="this is innerhtml"></div>

 

Wrong:

<div [innerHTML]='{{article?.htmlcontent}}'></div>