文章详情页
angular.js - angularjs的ng-include的html必须是要在同一个服务器吗?
问题描述
想实现其他服务器的播放器到当前页面中,求问应该怎么实现?
问题解答
回答1:使用ng-include引入的文件必须是同一个域名下,所以想要实现的可能需要另辟蹊径了
回答2:默认是同源策略,如果你想加载其他不在同一个域的资源,你需要了解 $sce,设置白名单这是官网一段描述
By default, the template URL is restricted to the same domain and protocol as the application document. This is done by calling $sce.getTrustedResourceUrl on it. To load templates from other domains or protocols you may either whitelist them or wrap them as trusted values. Refer to Angular’s Strict Contextual Escaping.
标签:
HTML
上一条:angular.js - angular中的controller 的js文件如何修改css样式比如margin:0?下一条:前端 - 应该先从angularJS , vue.js , react 这些框架中的哪个开始入手?
相关文章:
1. Angular.js 无法设置Authorization头,该怎么解决?2. angular.js - angular中可以在ng-click中直接调用service的方法吗?3. angular.js - ionic 弹窗样式4. android - Menu的click监听器可以使用switch()case来匹配具体点击的Item吗?5. angular.js - 指令交互问题,未找到依赖指令6. angular.js - angularjs 注入模块报错 很怪异... 求解惑7. angular.js - 通过数据中children的个数自动生成能点击展开的div8. angular.js - angular参数问题9. angular.js - 在ng-option 里使用过滤器无效10. angular.js - ionic该如何强制刷新页面
排行榜