1

A simple application of route manager of AngularJs is not working in a chrome, but it is fine in fire fox. My code is here http://plnkr.co/edit/WIdRx1FTQ9HeZNkVPz74?p=preview , when we try to place index , homePage, script files in local , it is not working in chrome . I got error message in chrome console as No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. So what changes have to be made in my code to satisfy chrome.

Shekkar
  • 244
  • 3
  • 10
  • 21

2 Answers2

0

The issue is not with AngularJS. Please check here for the answer to your problem: Origin is not allowed by Access-Control-Allow-Origin

Community
  • 1
  • 1
JSager
  • 1,420
  • 9
  • 18
  • the problem is solved by running the application from Apache .If you have any code changes to run the application in local, please update the plunker link – Shekkar Apr 24 '14 at 05:41
  • It's not going to work from the file system because of Chrome trying to protect you from what it perceives as a cross domain attack. If you're looking for a way to run it on your local machine for development, I'd recommend using grunt to serve up your application. In fact, if you want to do some turbocharged angular development, you should look into what tools and frameworks are available to you. I'd google grunt, bower, yeoman, and this brings it all together for building a serious enterprise app: https://github.com/cgross/generator-cg-angular – JSager Apr 24 '14 at 14:26
0

Some browsers like Chrome do not allow cross-origin on file://

Make sure you are running the application from a local server(like Wamp)

Then it will work

Puneet
  • 654
  • 1
  • 8
  • 16