0
<body ng-app>
    <div ng-include="'http://www.google.com/'"></div>
</body>

The ng-include handy directive lets us include the contents of another file within our document. But the html above mentioned is not working as it is not able to display the contents of the url mentioned. The same code works fine if some local relative file is mentioned. Please clarify my concept. Thanks is advance.

1 Answers1

1

Documentation says

By default, the template URL is restricted to the same domain and protocol as the application document.

In addition, the browser's Same Origin Policy and Cross-Origin Resource Sharing (CORS) policy may further restrict whether the template is successfully loaded. For example, ngInclude won't work for cross-domain requests on all browsers and for file:// access on some browsers.

asdf_enel_hak
  • 7,474
  • 5
  • 42
  • 84
  • See here for further information: http://stackoverflow.com/questions/19994161/how-do-i-get-ng-include-directive-to-work-with-a-content-delivery-network – Sarhanis Mar 02 '16 at 11:15