成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術文章
文章詳情頁

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
相關文章: