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
  • 7,596
  • 15
  • 68
  • 133

1 Answers1

1

You should use innerHTML :

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

WORKING DEMO

Vivek Doshi
  • 52,153
  • 9
  • 101
  • 113