I got the following error inside my input:
SafeValue must use [property]=binding: http://www.myurl.com (see http://g.co/ng/security#xss)
I did in my component:
this.myInputURL = this.sanitizer.bypassSecurityTrustUrl('http://www.myurl.com');
And in my template:
Share URL: <md-input [value]="myInputURL" type="text"></md-input>
What's wrong?
change this
this.sanitizer.bypassSecurityTrustUrl('http://www.myurl.com');
to
this.sanitizer.bypassSecurityTrustResourceUrl('http://www.myurl.com');
Bypass security and trust the given value to be a safe style URL, i.e. a value that can be used in hyperlinks or . source angular.io
Bypass security and trust the given value to be a safe resource URL, i.e. a location that may be used to load executable code from, like , or . source angular.io
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With