後にエラーがスローされます。AngularJsは、私はエラーを取得する私のangularjsコードを縮小化した後、縮小化
モジュールアプリをインスタンス化できませんでしたが原因: エラー:[$インジェクター:UNPR]不明者:トン
コードは、 - 生成フラグを除き、ギャルプを実行した場合にのみ機能します。
//All dependencies used in below are minified in a single file
(function(){
angular
.module('app', [
'ngMessages',
'ngStorage',
'ngAnimate',
'toastr',
'ngSanitize'
]);
})();
サービスコード
(function(){
'use strict';
angular
.module('app')
.factory('dataservice', dataservice);
dataservice.$inject = ['$http','$localStorage','toastr'];
function dataservice($http,$localStorage,toastr) {
//Code inside this function uses all 3 dependencies injected
}
})();
コントローラー・コード
(function(){
'use strict';
angular
.module('app')
.controller('LoginController',LoginController);
LoginController.$inject = ['$localStorage','dataservice','toastr','$scope','$sanitize'];
function LoginController($localStorage,dataservice,toastr,$scope,$sanitize) {
/// All 5 dependencies injected here are used inside this function.
}
})();
私は東海岸のDDoSのリンクを上げるのは苦労していますが、ng-annotateをチェックしてください。これは、Minification breaking Angularの問題を解決します。 –