💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
## 第十三章 依赖注入 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