Here is my problem, I want to include a button inside an HTML template that links to an external website. But when the HTML is being read, Google Chrome says:
WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security
It seems that the Angular 2 innerHTML attribute does not allow the use of 2 recursive HTML bindings.
Here is my code:
<ion-col width-80 innerHtml="{{ slide.content + '<p><button round full (click)=`'
+ slide.button.url +'`>'+slide.button.text+'</button>' }}"></ion-col>
The attribute (click) is deleted, and only (slide.button.text)displayed as separate text.
Any solution?
slide as follows:
{
img: 'img/picture.png',
content: `sometext`,
button : {
url: `http://www.foo.com`,
text: `Site foo`
}
}
source
share