Truly turning crazy over this one:
I am trying to combine AngularJS and RequireJS. After several failed attempts I turned to AngularAMD. I followed the basic process, but I keep getting this nasty error:
Failed to instantiate module ngStorage due to: Module 'ngStorage' is not available! You either misspelled the module name or forgot to load it...
ngStorage is a simple 3rd party Angular module.
Here's my main.js:
require.config({
paths: {
angular: 'js/angular.min',
angularAMD: 'js/angularAMD.min',
ngload: 'js/ngload.min',
ngStorage: 'js/ngStorage.min'
},
shim: {
angularAMD: ['angular'],
ngload: ['angularAMD'],
ngStorage: ['angular'] // Also tried with ['angularAMD'], and without this line at all
},
deps: ['js/app']
});
And my app.js:
define(['angularAMD','ngStorage'], function(angularAMD) {
var app = angular.module('tyleApp', ['ngStorage']);
return angularAMD.bootstrap(app); // Fails here...
});
I removed everything else from the app, and it just fails here... What am I doing wrong?
Note: I also tried with:
define(['angularAMD','ngload!ngStorage'], function(angularAMD) {
But then I get:
angularAMD not initialized. Need to call angularAMD.bootstrap(app) first.