0

Introduction

I development a struct using AngularJS and RequireJS. I started REquireJS in little time ago and show difficulties in implement AngularJS in RequireJS.

Problem

My problem it is in dependencies in app/assets/js/app.js:4 :

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.1/$injector/modulerr?p0=opaApp&p1=Error%3A%….0.1%3A57966%2Fapp%2Fassets%2Flibs%2Fangularjs%2Fangular.min.js%3A19%3A219)

Conclusion

If you have any tips for improvement, please share them.

Code - update

github

2
  • 1
    Well short answer is your are not setting up the require modules correctly (it's looking for a module that it can't find mostly likely because it is not injected correctly) , would have to see the code and setup you have for requirejs and angular though. Maybe set up one example in a plunkr or drop it in here or something? Commented Jun 17, 2015 at 17:20
  • @ajmajmajma sorry, I forget xD. Add Code above. Thanks! Commented Jun 17, 2015 at 17:43

1 Answer 1

1

Manually bootstrap your application after defining the app module, instead of using the ng-app directive.

So, remove ng-app="opaApp" from the html tag in index.html and add

angular.bootstrap(document, ['opaApp']);

after angular.module('opaApp', ['opaApp.application']); in app.js

The reason you are getting the error is because angular tries to start the application (looking at the ng-app directive) before the opaApp module is defined.

Sign up to request clarification or add additional context in comments.

Comments

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.