ARV*_*ARV 3 javascript html5 youtube-javascript-api angularjs
为什么这个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>
Run Code Online (Sandbox Code Playgroud)
和
var app = angular.module('my-app', []);
app.controller('AppController', function ($scope, $sce) {
$scope.videoID = $sce.trustAsResourceUrl('http://www.youtube.com/embed/C0DPdy98e4c');
});
Run Code Online (Sandbox Code Playgroud)
请参阅此文档.
| 归档时间: |
|
| 查看次数: |
6716 次 |
| 最近记录: |