Why 这个jsfiddle不管用?我无法获得价值videoId
。如果我删除ngRoute
从模块然后它工作正常。
你需要使用ng-src
像这样:
<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 本文档.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)