🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 第十三章 依赖注入 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