angular.js - angularjs的ng-include的html必須是要在同一個伺服器嗎?
伊谢尔伦
伊谢尔伦 2017-05-15 17:09:35
0
2
459

想實現其他伺服器的播放器到目前頁面中,求問該怎麼實現?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

全部回覆(2)
小葫芦

使用ng-include引入的檔案必須是同一個網域下,所以想要實現的可能需要另闢蹊徑了

Ty80

預設是同源策略,如果你想載入其他不在同一個網域的資源,你需要了解 $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.
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!