Angularjs: Controllers’ dependency and parameter should be in the same order

The order should be exactly the same

HomeControllers.controller('LogoutController', ['$scope','$rootScope', '$localStorage', '$location', '$http', 
                                       function($scope,   $rootScope,   $localStorage,    $location,  $http){ ...

Otherwise, you may endup putting Zhang’s Hat to Li’s.

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.