当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript DomSanitizationService.bypassSecurityTrustResourceUrl方法代码示例

本文整理汇总了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');
     }
开发者ID:ryankwilson,项目名称:challengeapp,代码行数:9,代码来源:challenges.component.ts

示例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);
 }
开发者ID:AndresRicardoTorres,项目名称:angular.io,代码行数:8,代码来源:bypass-security.component.ts

示例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!
 }
开发者ID:raviraju,项目名称:teach2educateApp,代码行数:7,代码来源:student-resubmit.ts

示例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);
 }
开发者ID:manoj2589,项目名称:Renters-Realty,代码行数:9,代码来源:virtualRealityView.ts

示例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);
 }
开发者ID:ClementVidal,项目名称:angular-fr,代码行数:10,代码来源:bypass-security.component.ts

示例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);

  }
开发者ID:neoalienson,项目名称:respond,代码行数:14,代码来源:edit.component.ts

示例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) {
开发者ID:RashmiNalwad,项目名称:T2E_StudentView,代码行数:11,代码来源:student-completed.ts

示例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"];
 }
开发者ID:raviraju,项目名称:teach2educateApp,代码行数:11,代码来源:student-completed.ts

示例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);
       }
     });
 }
开发者ID:RashmiNalwad,项目名称:Teach2Ed,代码行数:19,代码来源:student-assignment.ts

示例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);
 }
开发者ID:wadendo,项目名称:angular2-app,代码行数:5,代码来源:my-video.component.ts


注:本文中的@angular/platform-browser.DomSanitizationService.bypassSecurityTrustResourceUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。