Sydney
Sydney

Reputation: 12212

Uncaught Error: No module: myApp Plunker inside

I have a simple setup of an angularjs application. The scripts are loaded with requirejs. When loading the application, I get Uncaught Error: No module: myapp in the console.

The scripts are loaded in order scripts.js (requirejs configuration), jquery, angular and then app.

Here is the Plunker.

Upvotes: 1

Views: 1723

Answers (1)

Buu
Buu

Reputation: 50335

You need to remove the ng-app directive from the html element. See the updated Plunker.

First, the directive is not necessary, because you already manual bootstrap AngularJS (and ng-app is simply the shortcut to do that).

Second, the reason AngularJS reports the error is because when it processes ng-app (upon document ready event), the module file (in app.js) has not been loaded by RequireJS (that's why you have to do manual bootstrap in the first place).

Upvotes: 4

Related Questions