本文整理汇总了TypeScript中@angular/platform-browser.DomSanitizationService.bypassSecurityTrustResourceUrl方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DomSanitizationService.bypassSecurityTrustResourceUrl方法的具体用法?TypeScript DomSanitizationService.bypassSecurityTrustResourceUrl怎么用?TypeScript DomSanitizationService.bypassSecurityTrustResourceUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/platform-browser.DomSanitizationService
的用法示例。
在下文中一共展示了DomSanitizationService.bypassSecurityTrustResourceUrl方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(
private route: ActivatedRoute,
private challengesService: ChallengesService,
private identityService: IdentityService,
private sanitizer: DomSanitizationService) {
//this.introUrl = this.sanitizer.bypassSecurityTrustResourceUrl('https://www.youtube.com/embed/C-yYyvmjqfY?autoplay=1');
this.introUrl = this.sanitizer.bypassSecurityTrustResourceUrl('https://player.vimeo.com/video/301290028');
this.outroUrl = this.sanitizer.bypassSecurityTrustResourceUrl('https://player.vimeo.com/video/301290822');
}
示例2: updateVideoUrl
// #docregion trust-video-url
updateVideoUrl(id: string) {
// Appending an ID to a YouTube URL is safe.
// Always make sure to construct SafeValue objects as close as possible to the input data, so
// that it's easier to check if the value is safe.
this.videoUrl =
this.sanitizer.bypassSecurityTrustResourceUrl('https://www.youtube.com/embed/' + id);
}
示例3: ngOnInit
ngOnInit() {
//console.log(this.assignmentDetail);
this.myresponse = this.assignmentDetail["responses"][this.email];
//console.log(this.myresponse);
this.assignment_url = this.myresponse["attachmentUrl"];
this.url = this.sanitizer.bypassSecurityTrustResourceUrl(this.assignment_url);//WARNING: calling this method with untrusted user data exposes your application to XSS security risks!
}
示例4: setUrlForVirtualRealityView
setUrlForVirtualRealityView(){
let viewURL:string="";
if(this.viewBy =="RoundMe") {
viewURL = this.roundMeURLService.getRoundMeUrlForVirtualRealityView(this.bedroomType);
}else if(this.viewBy =="Google") {
viewURL = this.googleURLService.getGoogleUrlForVirtualRealityView(this.bedroomType);
}
this.linkURL= this.sanitizer.bypassSecurityTrustResourceUrl(viewURL);
}
示例5: updateVideoUrl
// #docregion trust-video-url
updateVideoUrl(id: string) {
// Ajouter un ID à une URL YouTuve n'est pas risqué.
// Veillez à toujours construire des objets SafeValue aussi fidèles
// que possible aux données entrées afin de faciliter
// leur vérification.
this.urlDangereuseDeVideo = 'https://www.youtube.com/embed/' + id;
this.urlDeVideo =
this.sanitizer.bypassSecurityTrustResourceUrl(this.urlDangereuseDeVideo);
}
示例6: ngOnInit
/**
* Init pages
*
*/
ngOnInit() {
var id, pageUrl;
id = localStorage.getItem('respond.siteId');
pageUrl = localStorage.getItem('respond.pageUrl');
this.url = this._sanitizer.bypassSecurityTrustResourceUrl('/edit?q=' + id + '/' + pageUrl);
}
示例7:
this.dataService.getAssignmentInfo(this.assignment).then((assignmentDetail_info) => {
if (assignmentDetail_info) {
this.myresponse = assignmentDetail_info["responses"][this.email];
console.log(this.myresponse);
this.assignment_url = this.myresponse["attachmentUrl"];
this.url = this.sanitizer.bypassSecurityTrustResourceUrl(this.assignment_url);//WARNING: calling this method with untrusted user data exposes your application to XSS security risks!
this.cumulative_rating = this.myresponse["cumulative_rating"];
this.teacherFeedback = this.myresponse["teacher_feedback"]["Comment"];
this.teacherRating = this.myresponse["teacher_feedback"]["Rating on Scale of 5"];
}
}).catch(function(exception) {
示例8: ngOnInit
ngOnInit() {
this.myresponse = this.assignmentDetail["responses"][this.email];
//console.log(this.myresponse);
this.assignment_url = this.myresponse["attachmentUrl"];
this.url = this.sanitizer.bypassSecurityTrustResourceUrl(this.assignment_url);//WARNING: calling this method with untrusted user data exposes your application to XSS security risks!
this.cumulative_rating = this.myresponse["cumulative_rating"];
this.teacherFeedbackSubmitted = this.myresponse["teacher_feedback"]["feedback_submitted"];
console.log(this.teacherFeedbackSubmitted);
this.teacherFeedback = this.myresponse["teacher_feedback"]["Comment"];
this.teacherRating = this.myresponse["teacher_feedback"]["Rating on Scale of 5"];
}
示例9: ngOnInit
ngOnInit(){
//console.log(this.response);
let d = new Date(this.response.submittedOn);
this.submitted_on = d.toLocaleString()//d.toDateString();
this.url = this.sanitizer.bypassSecurityTrustResourceUrl(this.response.attachmentUrl);//WARNING: calling this method with untrusted user data exposes your application to XSS security risks!
var obj=this;
this.dataService.getBasicUserInfo(obj.student_id).then(function(response){
//console.log(response);
if(response){
obj.fname = response["first_name"];
obj.lname = response["last_name"];
obj.gender = response["gender"];
obj.getAvatar();
}else{
let toastmsg = obj.lib.showToastMsgWithCloseButton("Unable to fetch user info for " + obj.student_id);
obj.nav.present(toastmsg);
}
});
}
示例10: constructor
constructor(sanitizer: DomSanitizationService, mediaService : MediaServiceService) {
this.myUrl = mediaService.getMedia() || sanitizer.bypassSecurityTrustResourceUrl('https://www.youtube.com/v/Gy-xz4JCI1Q');
console.log(mediaService.getMedia());
//console.log(this.myUrl);
}