homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

ng include

 7:58 am on Jun 4, 2014 (gmt 0)

im testing angular for my website.
Ng include in the page works in Firefox but not in Chrome
What could be the issue



 1:27 pm on Jun 4, 2014 (gmt 0)

Do you see anything in the console log? Also, do you have the Batarang Chrome plugin for Angular? Might help to debug what is going on.

What version of Angular?


 1:53 pm on Jun 4, 2014 (gmt 0)

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.

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.


Are you loading content from a different origin and perhaps you need to wrap it as a trusted resource?


 2:46 am on Jun 8, 2014 (gmt 0)

hi fotiman,

tx for your help

ng-include works only if the page is accessed through server and not locally in chrome. But it is supported locally in Firefox. Lesson learnt

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved