angularjs依赖注入

angular.module('app')

  .controller("IndexController", IndexController);

IndexController.$inject = ['CustomerService','StorageService','IMSqliteUtilService','SysMsgService', 'MsgService','$scope','$rootScope','$ionicHistory','$state','ConfigService', '$ionicScrollDelegate', '$timeout','CityService' , 'UtilService', 'UserService', 'TaskIndexService', '$ionicSlideBoxDelegate', 'MerchantIndexService', 'BlackService', 'BannerService', 'SqliteUtilService', '$window','$location','$ionicTabsDelegate','$ionicModal'];


function IndexController (CustomerService,StorageService,IMSqliteUtilService,SysMsgService, MsgService,$scope,$rootScope,$ionicHistory,$state,ConfigService, $ionicScrollDelegate, $timeout,CityService , UtilService, UserService, TaskIndexService, $ionicSlideBoxDelegate, MerchantIndexService, BlackService, BannerService, SqliteUtilService, $window,$location,$ionicTabsDelegate,$ionicModal){


}

这是ionic项目里首页controller的依赖注入,注入的东西实在过多,想请问各位前辈有没有好的优化的思路或者方法可以借鉴。

素胚勾勒不出你
浏览 594回答 1
1回答

杨魅力

首先想问下,你这个controller负责了多少东西,为什么会依赖这么多东西?十几个依赖
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript