Angularjs 如何在ionic view中获取选项卡式数据
我在控制器中发送http请求,视图在加载时呈现来自web服务的数据。其中一个web服务需要很长时间才能完成,控制器代码:Angularjs 如何在ionic view中获取选项卡式数据,angularjs,ionic-framework,navbar,Angularjs,Ionic Framework,Navbar,我在控制器中发送http请求,视图在加载时呈现来自web服务的数据。其中一个web服务需要很长时间才能完成,控制器代码: $scope.doRefresh = function() { //$http.get('http://inda208350.in.fid-intl.com:9090/appstatus/') $http.get('http://inda232218.in.fid-intl.com:9090/appstatus/') .succes
$scope.doRefresh = function() {
//$http.get('http://inda208350.in.fid-intl.com:9090/appstatus/')
$http.get('http://inda232218.in.fid-intl.com:9090/appstatus/')
.success(function(newItems) {
$scope.content = newItems;
})
.finally(function() {
// Stop the ion-refresher from spinning
$scope.$broadcast('scroll.refreshComplete');
});
};
$ionicLoading.show({
content: 'Loading',
animation: 'fade-in',
showBackdrop: true,
maxWidth: 200,
showDelay: 10
});
// DataTables configurable options
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withDisplayLength(10)
.withOption('bLengthChange', false);
/* Get App Status */
$http.get('http://inda232218.in.fid-intl.com:9090/appstatus/').success(function(responseAppsData){
$ionicLoading.hide();
$scope.content = responseAppsData;
$scope.appNm = $stateParams.appName;
$scope.appSt = $stateParams.appStatus;
})
.error(function(responseAppsData){
$ionicLoading.hide();
alert("Details Status Please call EPS for support..!!");
})
$ionicLoading.show({
content: 'Loading',
animation: 'fade-in',
showBackdrop: true,
maxWidth: 200,
showDelay: 10
});
/* Get Index Based Issues*/
$http.get('http://inda232218.in.fid-intl.com:9090/indexinfo/').success(function(responseAppsData){
$scope.content1 = responseAppsData;
$scope.app = $stateParams.appName;
})
.error(function(responseAppsData){
$ionicLoading.hide();
alert("Details Status Please call EPS for support..!!");
})
/* Get Holding Based Issues*/
$http.get('http://inda232218.in.fid-intl.com:9090/holdinginfo/').success(function(data, status, headers, config) {
$scope.content2 = data;
})
.error(function(responseAppsData){
$ionicLoading.hide();
alert("Details Status Please call EPS for support..!!");
})
/* Get Cash Based Issues*/
$http.get('http://inda232218.in.fid-intl.com:9090/cashdata/').success(function(data, status, headers, config) {
$scope.content4 = data;
})
.error(function(responseAppsData){
$ionicLoading.hide();
alert("Details Status Please call EPS for support..!!");
})
/* Get Discovery Based Issues*/
$http.get('http://inda232218.in.fid-intl.com:9090/discovery_details/').success(function(data, status, headers, config) {
$scope.content3 = data;
})
.error(function(responseAppsData){
$ionicLoading.hide();
alert("Please call EPS for support..!!");
})
$ionicLoading.hide();
})
控制器还包含以下服务:
控制器('DetailStatusCtrl',函数($scope、$stateParams、$http、$timeout、$ionicLoading、DTOptionsBuilder、DTColumnBuilder、$q)
在单个视图中,我需要一个表格/选项卡式数据,就像使用w3导航栏一样,单击一个栏,我将从1个web服务中获取数据,单击其他选项卡,我将从其他web服务中获取数据。我正在考虑的解决方案之一是将控制器拆分为2个,然后在单击选项卡时调用特定的控制器。有人可以吗有什么办法