0

When I use innerHTML like this the buttons will not show in the view. The button tags are remove.

inside component

const htmldata = '<button>test</button>

template

<div class="body" [innerHTML]="htmldata"></div>
Raymond the Developer
  • 1,576
  • 5
  • 26
  • 57
  • using this.sanitizer.bypassSecurityTrustHtml, see, e.g. https://stackoverflow.com/questions/59998831/angular-dynamic-button-implement-in-html/60000023#60000023 – Eliseo Feb 12 '20 at 17:07
  • I think you will get the answer here: https://stackoverflow.com/questions/37076867/in-rc-1-some-styles-cant-be-added-using-binding-syntax/37076868#37076868 – Jijeesh Feb 12 '20 at 17:09

0 Answers0