文章详情页
angular.js - angularjs的ng-include的html必须是要在同一个服务器吗?
浏览:133日期:2024-03-13 16:15:16
问题描述
想实现其他服务器的播放器到当前页面中,求问应该怎么实现?
问题解答
回答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. 什么是前后端分离?用vue angular等js框架就能实现前后分离了吗?2. ddos - apache日志很多其它网址,什么情况?3. android - 百度地图加载完成监听4. 这是什么情况???5. css - chrome浏览器input记录上次cookie信息后,有个黄色背景~如何去除!6. android - 如何实现QQ pad 点击右侧输入框,只顶右侧的布局,左侧布局不动7. vue.js - vue-router开启HTML5的history模式后nginx配置8. javascript - 百度地图自己的产品可以精确定位,为什么我调用他的公开API却必须经过用户同意才能获取精确定位,而且还慢?9. javascript - angular循环的时候取到的值是最后一个值10. html5 - iOS的webview加载出来的H5网页,怎么修改html标签select的样式字体?
排行榜
