【发布时间】:2015-06-22 17:02:00
【问题描述】:
如果我有类似this question on injecting another controller to a directive的代码:
angular.module('paramApp', []);
angular.module('paramApp').controller('ParamCtrl', ['$scope', '$http', function($scope, $http) {
.
.
.
}]);
angular.module('deviceApp', ['paramApp']);
angular.module('deviceApp').directive('DeviceDirective', function () {
return {
.
.
.
controller: 'ParamCtrl'
};
});
我在缩小js时,$scope和$http的注入依赖中断,如何在创建DeviceDirective时显式定义ParamCtrl的依赖以防止uncaught injector issues with bundled js?
【问题讨论】:
标签: javascript angularjs dependency-injection bundling-and-minification