homepage Welcome to WebmasterWorld Guest from 54.237.98.229
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
ng include
dukelips

5+ Year Member



 
Msg#: 4677328 posted 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

 

Fotiman

WebmasterWorld Senior Member fotiman us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 4677328 posted 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?

Fotiman

WebmasterWorld Senior Member fotiman us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 4677328 posted 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.

https://docs.angularjs.org/api/ng/directive/ngInclude

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

dukelips

5+ Year Member



 
Msg#: 4677328 posted 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