iamblue / generator-angular-ui-router

I add "ui-router" in this module. Fork from https://github.com/yeoman/generator-angular
71 stars 28 forks source link

New states generated above '$stateProvider' in app.js Angular module #14

Open bmwertman opened 10 years ago

bmwertman commented 10 years ago

When new routes are generated using "yo angular-ui-router:route myroute" the new states are generated above '$stateProvider' in the app.js Angular module.

This causes the following error: "Uncaught Error: No module: myappnameApp"

arepalli-praveenkumar commented 10 years ago

Yes .Me too faced same issue

emaV commented 9 years ago

The fix works for javascript, not for coffee indeed.

It uses a different needle just below the last .state in the template. Even it reads as a comment for the following line the indentation is kept as the previous lines so new state added keeps the right indentation.

You can make it work in your installed code adding the line // ui-otherwise just below your last state and patching your local generator (in my Mac is /usr/local/lib/node_modules/generator-angular-ui-router. Please note the indentation!