## 第十三章 依賴注入
AngularJS 使用 $injector 來管理依賴關系的查詢與實例化。
```
angular.module('myApp')
.factory('greeter', function(){
return {
greet: function(msg){
alert(msg);
};
}
})
.controller('MyCtrl', function($scope, greeter){
$scope.sayHello = function(msg){
greeter.greet(msg);
};
});
```
### ngMin
>[success] npm install -g ngmin
>$ ngmin input.js output.js
Grunt
>[success] grunt-ngmin