|
| xqd
@@ -36,20 +36,31 @@ starter.controller('loginCtrl',["$scope",'$state','$ionicLoading','$timeout','$i
|
|
|
|
|
|
}])
|
|
|
|
|
|
-starter.controller('homeCtrl',["$scope",'$http','$timeout',function($scope,$http,$timeout){
|
|
|
+starter.controller('homeCtrl',["$scope",'$http','$timeout','$ionicLoading',function($scope,$http,$timeout,$ionicLoading){
|
|
|
$scope.excals = [
|
|
|
{'list':'测试一'},
|
|
|
{'list':'测试二'},
|
|
|
{'list':'测试三'}
|
|
|
];
|
|
|
$scope.doRefresh = function(){
|
|
|
- $http.get('../lib/ionic/test.json')
|
|
|
+ $ionicLoading.show({
|
|
|
+ tcontent: 'Loading',
|
|
|
+ animation: 'fade-in',
|
|
|
+ showBackdrop: true,
|
|
|
+ maxWidth: 200,
|
|
|
+ showDelay: 0
|
|
|
+ });
|
|
|
+ $timeout(function(){
|
|
|
+ $ionicLoading.hide();
|
|
|
+ $http.get('../lib/ionic/test.json')
|
|
|
.success(function(newItems) {
|
|
|
$scope.excals = newItems;
|
|
|
})
|
|
|
.finally(function() {
|
|
|
$scope.$broadcast('scroll.refreshComplete');
|
|
|
});
|
|
|
+ },1000);
|
|
|
+
|
|
|
}
|
|
|
}])
|
|
|
//展示首页控制器
|