Welcome to WebmasterWorld Guest from 50.19.156.133

Forum Moderators: open

Message Too Old, No Replies

ng include

     

dukelips

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

5+ Year Member



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

Fotiman

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

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



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

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

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month




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.

[docs.angularjs.org...]

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

dukelips

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

5+ Year Member



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
 

Featured Threads

Hot Threads This Week

Hot Threads This Month