1
我一直在关注AngularJS的一些教程,我发现有多种方法来初始化Controller。AngularJS - 初始化控制器的正确语法是什么?
例如,下面的代码是基于AngularJS文档:
angular.module('todoList', [])
.controller('todoListCtrl', ['$scope',
function ($scope) {
...
}
]);
然而,该代码也可以工作:
angular.module('todoList', [])
.controller('todoListCtrl',
function ($scope) {
...
}
);
优于另一种方法?
我从来没有听说过'uglifier'这个名字,这可能是我的前身 –
Closure,Grunt/gulp包,RequireJS,Webpack的一些工具......它们都有一个“uglifier”,它将代码库重命名为它紧凑。例如:https://www.npmjs.com/package/gulp-uglify –