I have a problem with my AngularJS 2 app (I am using RC5 version of AngularJS 2). It seems that a sanitized URL is triggering change detection which then updates the div>
Combined the previous answers to get it working this way:
component.ts (only the relevant parts)
import { DomSanitizer } from '@angular/platform-browser';
constructor(
private sanitizer: DomSanitizer
) {
this.sanitizer = sanitizer;
}
ngOnInit() {
this.getTrustedUrl('http://someUrl');
}
getTrustedUrl(url:any){
this.safeUrl = this.sanitizer.bypassSecurityTrustResourceUrl(url);
}
template.html