button when clicked inject a html markup that represent new product name and quantity to be added to the cart. After the client submit the form i want those product stored in an array of object.
The problem i faced is angular 6 security that hide some html tag like input.
Trying to bypass this security issue i create a Pipe called SafePipe that transform html to DomSenitizer
<div [innerHTML]="htmltobeadded | safe>
this worked fine in the template like this.
Inside the button method i used javascript to inject the htmltobeadd and the security issue came again.
document.getElementById("add").innerHTML = htmltobeadded
I use safePipe.transform() to transfrom my html to Domsenitizer
safehtml = safepipe.tranform(htmltobeadded)
and used
document.getElementById("add").innerHTML = safehtml
Error: safehtml is not assignable to type string