search

Home  >  Q&A  >  body text

angular.js - angularjs的ng-include的html必须是要在同一个服务器吗?

想实现其他服务器的播放器到当前页面中,求问应该怎么实现?

伊谢尔伦伊谢尔伦2744 days ago486

reply all(2)I'll reply

  • 高洛峰

    高洛峰2017-05-15 17:11:35

    The files introduced using ng-include must be under the same domain name, so what you want to achieve may need to find another way

    reply
    0
  • PHP中文网

    PHP中文网2017-05-15 17:11:35

    The default is the same origin policy. If you want to load other resources that are not in the same domain, you need to understand $sce and set up a whitelist
    This is a description from the official website

    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.

    reply
    0
  • Cancelreply