文章詳情頁
angular.js - angularjs的ng-include的html必須是要在同一個服務器嗎?
瀏覽:121日期: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. java類加載機制-類定義中new如何理解2. android - 使用vue.js進行原生開發如何進行Class綁定3. java - c++ 經常出現error LNK20194. mysql取模分表與分表5. mysql - 大部分數據沒有行溢出的text字段是否需要拆表6. mysql federated引擎無法開啟7. 常量在外面不加引號會報錯。8. wordpress里,這樣的目錄列表是屬于小工具還是啥?9. 怎么在phpstudy中用phpexcel上傳數據到MYSQL?10. dump(Db::query(’SELECT * FROM `user`’));的時候提醒錯誤。
排行榜
