1
 mainApp
 .controller('homeController',
   function($scope, $http, $timeout, $compile, $rootScope, $routeParams, $location, $route) {
      //code goes here
   }
);

 mainApp.controller('ReportsController',
    function($scope, $http, $rootScope) {
       //another controller code goes here
    }
);

reportsController ページのリロード時に、reportsController で homeController を呼び出すつもりですが、どのように呼び出すことができますか?

4

2 に答える 2

0

答えを得た:

apprun.js に依存関係を追加します

$location その後

mainApp.run(function($rootScope, $rootScope, $window,$location){

$location.path('/');
});
于 2015-10-28T14:11:24.443 に答える