AngularJs with iframe

前端 未结 1 841
忘掉有多难
忘掉有多难 2021-01-21 11:08

Why this jsfiddle is not working? I am not able to get value of videoId. If I remove ngRoute from module then it is working fine.

1条回答
  •  不思量自难忘°
    2021-01-21 11:39

    You need to use ng-src like this:

    {{videoID}}

    and

    var app = angular.module('my-app', []);
    app.controller('AppController', function ($scope, $sce) {  
        $scope.videoID = $sce.trustAsResourceUrl('http://www.youtube.com/embed/C0DPdy98e4c');
    });
    

    See this documentation.

    0 讨论(0)
提交回复
热议问题