Encountering an error message that says
GET http://localhost:8100/null 404 (Not Found)
I've experimented with various DomSanitizer methods, but so far none of them have resolved the issue.
The function in my controller is as follows:
import { DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';
constructor(public navCtrl: NavController, public navParams: NavParams, public loadingCtrl: LoadingController,
private sanitizer: DomSanitizer) {}
ionViewWillEnter() {
let link = this.navParams.get('link'); // receives the link to be sanitized
console.log(link); //confirmed working
let url1 = this.sanitizer.bypassSecurityTrustResourceUrl(link);
console.log(url1); //also functioning correctly
}
The iframe code I am using is as shown below:
<iframe [src]="url1" height="100%" width="100%"
frameborder="0">
</iframe>
My current setup includes - Ionic 3.20.0 npm 5.5.0