文章詳情頁
angular.js - angularjs的ng-include的html必須是要在同一個服務器嗎?
瀏覽:147日期: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. 為什么HTML5規范中會包含一些和html無關的東西?如本地存儲等。2. javascript - 微信IOS頁面中input type=number輸入數字無法顯示,安卓顯示正常3. css3 - 寬度設置的都是百分比,為什么還是不適配移動端?4. Java。根據WSDL驗證SOAP消息5. html5 - 求一個獲取手機定位的小demo,web端的 Geolocation6. javascript - perfect-scrollbar 插件的使用7. javascript - 一個JS的算法,求大神解答8. javascript - web網頁版app返回上一頁按鈕在ios設備失效怎么辦?安卓上可以,代碼如下,請大神幫助,萬分感謝。9. javascript - h5頁面微信授權登錄后用戶關閉頁面再次進入又要授權10. html - 關于bootstrap中container、row、col的應用
排行榜
