How I can correct inject dependency P48Wallet in resolve for $routeProvider?
app.js
'use strict';
define(
[
'angularAMD',
'angular-route',
'angular-animate'
],
function (angularAMD) {
var app = angular.module('FilmOrder', ['ngRoute', 'ngAnimate']);
app.config(['$routeProvider', function($routeProvider){
$routeProvider
.when('/',
angularAMD.route({
templateUrl: 'static/js/application/views/main.html',
controller: 'application/controllers/Main',
resolve: {
films:
require(['application/services/P48Wallet', function(P48Wallet) {
return P48Wallet.getUserData();
}])
}
})
)
.when('/success',
angularAMD.route({
templateUrl: 'static/js/application/views/success.html',
controller: 'application/controllers/Success'
})
)
.otherwise({redirectTo: '/'});
}]);
angularAMD.bootstrap(app);
return app;
});
=========================================================
P48Wallet.js
'use strict';
define(['application/app', 'application/services/Http'], function(app) {
return app.factory('P48Wallet', function(Http) {
this.getUserData = function() {
return Http.post('?action=get_data');
};
return this;
});
});
=========================================================
I receive error:
Error: [$injector:unpr] http://errors.angularjs.org/undefined/$injector/unpr?p0=dProvider%20%3C-%20d