You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
839 B

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. angular.module('app.travels', ['pascalprecht.translate'])
  2. .controller('TravelsCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
  3. $scope.travels=[];
  4. $scope.doRefresh = function() {
  5. /* travels refresh: */
  6. $http.get(urlapi + 'travels')
  7. .then(function(data){
  8. console.log('data success travels');
  9. console.log(data); // for browser console
  10. $scope.travels = data.data; // for UI
  11. $scope.$broadcast('scroll.refreshComplete');//refresher stop
  12. }, function(data){
  13. console.log('data error');
  14. $scope.$broadcast('scroll.refreshComplete');//refresher stop
  15. $ionicLoading.show({ template: 'Error connecting server', noBackdrop: true, duration: 2000 });
  16. });
  17. };
  18. $scope.doRefresh();
  19. });