How to run AngularJS App locally without using a WebServer

1,475 views
Skip to first unread message

Vishal Sharma

unread,
Apr 7, 2016, 11:01:39 AM4/7/16
to AngularJS
Hello,

I have a SPA built using AngularJS framework. The index.html is the main page that has ng-view directive to load and display the templates.
The application uses Angular Route module to navigate to various pages within the application.
The problem is that I have to use a Webserver for the SPA to work. If I try to load the pages directly from the file system, I get a CORS error.
This error occurs on IE and Chrome. But the same SPA works without issues on the FireFox browser.

Could anyone please guide me so that the SPA can work on IE and Chrome as well without having to use a web server.

Thank you,

Vishal Sharma

Tito

unread,
Apr 7, 2016, 3:34:28 PM4/7/16
to AngularJS
pull down the necessary .js files locally in a certain folder and reference them

Lee Li

unread,
Apr 11, 2016, 3:09:58 AM4/11/16
to ang...@googlegroups.com
Why don't you use a web server? You can install NPM, then install http-server for running the codes.

Tito <yos...@gmail.com>于2016年4月8日周五 上午3:34写道:
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Tito

unread,
Apr 11, 2016, 11:05:35 AM4/11/16
to AngularJS
what errors are u seeing? post a screen shot or errors u r seeing
Reply all
Reply to author
Forward
0 new messages