Reputation: 15164
Without minification, my code runs fine, but when it is minified, the load function is not called:
$stateProvider
// logged-in pages ------------------------
.state("app", {
abstract: true,
template: "<div ui-view></div>",
resolve: {
load: function (appStarter) {
console.log("app.load");
var appStarterPromise = appStarter.start();
return appStarterPromise.then(function () {
$("body").removeClass("loading");
});
}
}
}).state("app.home", {
//...
Any idea why this is not firing, or how to debug it?
Upvotes: 0
Views: 64
Reputation: 1104
Try this:
resolve: {
load: ['appStarter', function (appStarter) {
console.log("app.load");
var appStarterPromise = appStarter.start();
return appStarterPromise.then(function () {
$("body").removeClass("loading");
});
}]
}
This is how you inject dependencies, minification proof!
Upvotes: 1