<!--HTML CODE-->
<p #mass_timings"></p>
//controller code
@ViewChild('mass_timings') mass_timings: ElementRef;
constructor(private domSanitizer:DomSanitizer)
getInnerHTMLValue(){
this.mass_timings.nativeElement.innerHTML =
this.domSanitizer.bypassSecurityTrustHtml(this.parishDetail.mass_timings);
}
but the output which the mass_timings is displaying is including the text:-
Safe value must use [property]=binding
at the beginning
How to remove this string.
You need to sanitize() the safevalue like this :
As the error message says, the sanitized HTML needs to be added using property binding:
StackBlitz example (based on Swapnil Patwa's Plunker - see comments below)
I was getting this error when using an iframe so there I fixed using
[src]
as below: