文章详情页
angular.js - angularjs的ng-include的html必须是要在同一个服务器吗?
浏览:90日期: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. 【python小白】 问关于导入嵌套的包的问题2. javascript - nodejs关于进程间发送句柄的一点疑问3. javascript - vue2.0动态加载多个相同组件,给组件中的data输入不同的值,关闭非最后一个组件时,销毁的值是最后一个组件值。4. fragment - android webView 返回后怎么禁止重新渲染?5. python - 子进程执行完成为僵尸进程,怎么解决6. javascript - QQ第三方登录的问题7. php自学从哪里开始?8. mysql - SQL 这个 left jion 和 left outer jion 怎么结果是一样的?9. 初来乍到,相对路径问题,新手求教10. 基于Nginx的Wordpress安装失败?
排行榜
