0

I have a rails app which uses angular. It is also using ui router for routing. I first had all js codes in app.js and it works well. But I think its very hard to maintain in the long run. So I moved the controllers code to its own folder and it stopped working. Now My app cant find my controller and getting this error

Uncaught Error: [$injector:modulerr] Failed to instantiate module appname due to: Error: [$injector:modulerr] Failed to instantiate module homeCtrl due to:

I have created a test app to demonstrate this.. https://bitbucket.org/flyingboy007/testapp

Could some one tell me whats wrong here?

1
  • just remove homeCtrl dependency form app.module.js, because we don't need that there. Commented May 27, 2016 at 9:55

1 Answer 1

1

just remove homeCtrl dependency form app.module.js, because we don't need that there.

angular.module("testapp", ['ui.router', 'templates', 'homeCtrl']);

to 

angular.module("testapp", ['ui.router', 'templates']);
Sign up to request clarification or add additional context in comments.

7 Comments

Havent noticed that.. Now the error is gone but its not rendering the home.html page as expected
showing this <ui-view class="ng-scope"></ui-view>== $0
no errors on console and when I select inspect on chrome the above is shown
i clone your project and fix the problem but not able to push .
you must do a pull request instead
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.