比如下面代码,导致传值会是undefined
angular.module('myApp').controller('CategoriesCtrl',
['$scope', '$http', '$stateParams',
function($scope, $stateParams, $http){
因为上边依赖注入时的顺序没有一一对应,纠正如下即可
angular.module('myApp').controller('CategoriesCtrl',
['$scope', '$http', '$stateParams',
function($scope, $http, $stateParams){