文章詳情頁
angular.js - angularjs的ng-include的html必須是要在同一個服務(wù)器嗎?
瀏覽:155日期:2024-03-13 16:15:16
問題描述
想實現(xiàn)其他服務(wù)器的播放器到當前頁面中,求問應(yīng)該怎么實現(xiàn)?
問題解答
回答1:使用ng-include引入的文件必須是同一個域名下,所以想要實現(xiàn)的可能需要另辟蹊徑了
回答2:默認是同源策略,如果你想加載其他不在同一個域的資源,你需要了解 $sce,設(shè)置白名單這是官網(wǎng)一段描述
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?下一條:前端 - 應(yīng)該先從angularJS , vue.js , react 這些框架中的哪個開始入手?
相關(guān)文章:
1. 如何解決Centos下Docker服務(wù)啟動無響應(yīng),且輸入docker命令無響應(yīng)?2. 我在centos容器里安裝docker,也就是在容器里安裝容器,報錯了?3. objective-c - IOS 分享到微信 提示 應(yīng)用消息數(shù)據(jù)錯誤4. android - 使用百度sdk調(diào)用SDKInitializer.initialize(this)時報錯?5. javascript - 微信h5發(fā)送圖文信息,部分設(shè)備點擊“發(fā)送”按鈕時沒反應(yīng),問題較難重現(xiàn),如何能找到可能存在問題的點?6. javascript - 音樂播放器-圖片旋轉(zhuǎn)7. android - 為 AppBarLayout 設(shè)置的背景圖片 TransitionDrawable 為什么只在第一次打開的時候有效?8. javascript - js中遞歸與for循環(huán)同時發(fā)生的時候,代碼的執(zhí)行順序是怎樣的?9. MySQL timestamp的默認值怎么設(shè)置?10. docker 17.03 怎么配置 registry mirror ?
排行榜

熱門標簽