문제

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.

도움이 되었습니까?

해결책

You need to use ng-src like this:

<div ng-controller="AppController">
    <h1>{{videoID}}</h1>
    <iframe class="youtube-player" type="text/html" width="auto"
    height="auto" ng-src="{{videoID}}"
    allowfullscreen="" frameborder="0"> </iframe>
</div>

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top