Here's what I have in my app.js -
var app = angular.module("app", []);
And in my controller.js, I have -
app.service("Store", function() {
this.products = { item: "apple" };
});
app.controller("AppCtrl", function ($scope, Store) {
$scope.products = Store.products;
})
When I run it thru ngmin, I get this -
var app = angular.module('app', []);app.service('Store', function () {
this.products = { item: 'apple' };
});
app.controller('AppCtrl', function ($scope, Store) {
$scope.products = Store.products;
});
As you can see, it didn't annotate the dependencies correctly. However, if I have var app = angular.module("app", []);
in controller.js, it works just fine -
var app = angular.module('app', []);
app.service('Store', function () {
this.products = { item: 'apple' };
});
app.controller('AppCtrl', [
'$scope',
'Store',
function ($scope, Store) {
$scope.products = Store.products;
}
]);
How do I make ngmin
work with separate files?