0
如果使用$location.search()
,有什麼方法可以停止解析控制器數據。停止在搜索中解析控制器數據
下面是我的代碼
App.config(function($routeProvider, $locationProvider) {
$routerProvider.when('/overview' {
title:"Overview",
controller:"OverViewCtrl",
templateUrl:"pages/overview.html",
resolve:{
mainData:function(Service){
return Service.getOverviewData();
}
});
});
在我的控制,我使用了相同的
App.controller("OverViewCtrl", function($scope, $location, mainData, Service){
$scope.data = mainData.data;
$scope.otherData = null;
Service.getOtherData($location.search(), function(data){
$scope.otherData = data;
});
$scope.search = function(param){
$location.search(param);
};
});
每次search
方法被調用mainData
數據正從服務加載的,有沒有什麼辦法來調用搜索上的getOtherData
服務。