Here's my problem, I want to include a button inside an HTML template, that links to an external website. But, when HTML is read, Google Chrome says :
WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).
It seems that the Angular 2's innerHTML attribute doesn't allow 2 recursive HTML bindings.
Here's my code :
<ion-col width-80 innerHtml="{{ slide.content + '<p><button round full (click)=`'
+ slide.button.url +'`>'+slide.button.text+'</button>' }}"></ion-col>
The (click) attribute is deleted, and only (slide.button.text)
is displayed as single text.
Any solution ?
slide
is like this :
{
img: 'img/picture.png',
content: `sometext`,
button : {
url: `http://www.foo.com`,
text: `Site foo`
}
}
' | sanitizeHtml }}"`
– Thomas Dussaut Aug 09 '16 at 15:02