1

I want to create an updateable element in my app,

so in my html I have

<div>{{example}}</div>

then in my app component Ive done this..

example: string = `this is some text <br> this is more text`

but the output on the site was this is some text <br> this is more text so the whole thing was inserted as a string

Thanks

Smokey Dawson
  • 8,827
  • 19
  • 77
  • 152

1 Answers1

1

You should use innerHTML :

<div [innerHTML]="example"></div>

WORKING DEMO

Vivek Doshi
  • 56,649
  • 12
  • 110
  • 122