Rumah > Soal Jawab > teks badan
<video ng-src="/uploadfile/upload/image/{{videosrc}}" controls="controls"></video>
当我把video
换成img
的时候,是能看到{{videosrc}}
的值的
天蓬老师2017-04-17 11:54:58
<video ng-src="trustSrc(videosrc)" controls="controls"></video>
//controller 依赖 $scope, $sce
$scope.trustSrc = function(url){
return $sce.trustAsResourceUrl(url);
}
参考:https://code.angularjs.org/1.4.6/docs/api/ng/service/$sce