|
AngularJS iframe跨域打开内容时报错以及
AngularJS video src绑定数据的时候会提示下面错误 红色部分错误 解决方案
- <video id="video_a" ng-src="{{listData['video_url']}}" width="100%" preload="auto" controls="true" poster="{{ENV.videoUrl}}{{listData.img}}">
- Your browser does not support the video tag.
- </video>
复制代码
Error: [$interpolate:interr] Can't interpolate: {{listData['video_url']}}
Error: [$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy
解决方案 使用 $sceDelegateProvider 配置跨域请求域名
- app.config(function($sceDelegateProvider) {
- $sceDelegateProvider.resourceUrlWhitelist([
- // Allow same origin resource loads.
- 'self',
- // Allow loading from our assets domain. Notice the difference between * and **.
- 'http://media.w3.org/**']);
- });
复制代码
|
|