I am getting html from backend with function added in a link. when I add the same html to my element as innerHTML
the function is cleared. how to prevent that?
here is the sample code what i get from backend:
"Cookies help us provide a seemless experience to our dear customers. You agree to our usage of cookies by using our site.
<a href=\"#\" (click)=\"openPopupLink('footer.label.3.termsOfUse.desc')\">View Terms and Conditions</a>"
In the above there is function in the a
element, but when add this value in to one of the div as:
[innerHTML]
- the function "openPopupLink('footer.label.3.termsOfUse.desc')
- missing. what is the correct way to handle this?
my output gives just this: <a href="#">View Terms and Conditions</a>
UPDATE
<div class="popup-overlay" [ngClass]=popConditionalClass [hidden]=showPopup (click)="eventLayerClick()"></div>
<div class="popupDesc" [ngClass]=popConditionalClass [hidden]=showPopup>
<header>
<a class="modal-pop-close-btn" (click)="hidePopup(); $event.stopPropagation();" name="close"></a>
<h2 [innerHTML]="title"></h2>
</header>
<section [innerHTML]=htmlContent></section>
<footer></footer>
</div>