How to use Angular UI router with Node.js

Is there a way to use AngularUI Router with Node.js, something like jsdom or some way to set / insert the window object. I am writing an application using Browserify and Jasmine (no Karma) for testing. Module angular-node

NPM works fine in both environments, but it angular-ui-router

and angular-router

the two crashes, and I wonder if there is a solution for this case.

I don't actually need the routes to test, but I configured them in my app module and stops the testing process.

+3


source to share


2 answers


Maybe there is a routing framework like express. I use ui-router and node in my projects, basically I use express for all API calls then all other routes are handled by angular. You have configured the view engine to point to post and put the index.html file that the ng-app loads

app.set ('views', path.join (__ dirname, 'public'));



app.set ('view engine', 'html');

0


source


I'm a big fan of mean.js stack which has really great angular implementation including ui-router on express.

I would recommend checking it out for how to approach your problem. the template gives you a lot of opportunities to explore. bower is a great package manager for managing all of your client side dependencies.



Sorry, this is more or less just some advice. I am not very familiar with angular - node which I believe has got you into this conflict.

0


source







All Articles