| xqd
@@ -51,9 +51,9 @@ starter.controller('homeCtrl',["$scope",'$http','$timeout','$ionicLoading','$sta
|
|
|
$http({
|
|
|
method:'get',
|
|
|
url:config.server+'/list',
|
|
|
- }).success(function(newItem){
|
|
|
+ }).success(function(newItems){
|
|
|
$timeout(function(){
|
|
|
- $scope.excals = newItem
|
|
|
+ $scope.excals = newItems
|
|
|
$ionicLoading.hide();
|
|
|
});
|
|
|
}).error(function(){
|
| xqd
@@ -122,15 +122,23 @@ starter.controller('showCtrl',["$scope",'$ionicHistory','$state','$timeout','$st
|
|
|
$scope.doSelected = function(name){
|
|
|
if(localStorage.refreshtime!=0){
|
|
|
newtimer = $timeout(function() {
|
|
|
- $scope.doSelected(name);
|
|
|
+ $http({
|
|
|
+ method:'get',
|
|
|
+ url:config.server+'/list',
|
|
|
+ }).success(function(newItems){
|
|
|
+ if(newItems.length>0&&name)
|
|
|
+ $scope.doSelected(newItems[newItems.length-1]);
|
|
|
+ })
|
|
|
}, localStorage.refreshtime*1000);
|
|
|
}else{
|
|
|
+ $scope.selectedName(name);
|
|
|
$timeout.cancel(mytimer);
|
|
|
}
|
|
|
$scope.selectedName(name);
|
|
|
}
|
|
|
|
|
|
$scope.selectedName = function(name){
|
|
|
+ $scope.name = name;
|
|
|
$ionicLoading.show({
|
|
|
template: '加载中...',
|
|
|
});
|