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.

21 lines
826 B

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