I'm trying to sanitize a URL using bypassSecurityTrustResourceUrl
. However, regardless of what value I put in the argument I always get
Cannot read property
bypassSecurityTrustResourceUrl
of undefined
return this.sanitizer.bypassSecurityTrustResourceUrl('http://www.google.com');
Returns:
ERROR TypeError: Cannot read property
bypassSecurityTrustResourceUrl
of undefined atUrlSanitizerService.push../src/app/services/urlsanitizer.service.ts.UrlSanitizerService.sanitizeURL
Everywhere I've look says this should sanitize a url and allow it to be displayed via iframe. I may be misunderstanding what to put in for an argument. Any help would be appreciated, thank you!