Reputation: 13805
I have developed a front end app in angular2 using angular-cli.
then I created bundle using ng build
what I am really interested to know is that my app consist of only javascript & html files.
then why do I need to have a server?
My angular2 app is supposed to run directly from index.html i.e. by double clicking index.html.
isn't that right?
thanks
Upvotes: 1
Views: 58
Reputation: 657466
You need to use a server because browsers like Chrome limit how files can be accessed from the browser.
You don't need a specific server, just any HTTP server that is able to serve files so that the browser doesn't need to access them directly.
Upvotes: 4