Reputation: 3800
Do i need to host my angular application on a node server for it to work? I have been doing local development and am trying to integrate ui.router into my application but it does not seem to work because of the root/file/file/index.html file directory when running in the browser. Is that what is causing it or is it that I need to utilize these tools with a NodeJS server for them to cooperate.
Here is what I am doing with the ui.router
var app = angular.module("myapp",[
'ui.router'
]).config(function($stateProvider, $urlRouterProvider){
$stateProvider.state('login',{
url:'/login',
templateUrl:'views/login.html'
});
Solved the problem by just running the application on my server which resolved the ui.router problem.
Upvotes: 0
Views: 1263
Reputation: 6031
You will need a server to run your Angular app, not necessarily a node server.
From https://docs.angularjs.org/tutorial/ :
While Angular applications are purely client-side code, and it is possible to open them in a web browser directly from the file system, it is better to serve them from a HTTP web server. In particular, for security reasons, most modern browsers will not allow JavaScript to make server requests if the page is loaded directly from the file system.
Upvotes: 4