文章详情页
angular.js - angularjs的ng-include的html必须是要在同一个服务器吗?
浏览:254日期: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. php - 微信开发验证服务器有效性2. css - 文字排版问题,内容都是动态抓出来的,字数不一定。如何对齐啊3. 网页爬虫 - 关于Python的编码与解码问题4. javascript - Webapp 关闭后重新打开无需登录如何操作?5. java导入问题6. css3 - 微信前端页面遇到的transition过渡动画的bug7. javascript - vue.js 在使用期间遇到ios9.3.2不兼容问题8. javascript - Ajax返回json格式之后的数据解析后取出来的数据为undefined?9. 正则表达式 - Java:字符串替换带序号10. javascript - npm安装报错 系统w7 求大神解答
排行榜

网公网安备