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.
 
 
 

23 lines
864 B

angular.module('app.main', ['pascalprecht.translate'])
.controller('MainCtrl', function($scope, $stateParams, $translate, $filter,
$ionicLoading, $http) {
if (localStorage.getItem("cim_app_userdata")) {
$scope.storageuser = JSON.parse(localStorage.getItem("cim_app_userdata"));
console.log($scope.storageuser);
}
//get the num of pendent notifications each time
$http.get(urlapi + 'numnotifications')
.then(function(data) {
$scope.storageuser.notifications = data.data;
console.log(data.data);
localStorage.setItem("cim_app_storageuser", JSON.stringify($scope.storageuser));
}, function(data) {
console.log('data error');
$ionicLoading.show({
template: 'Error connecting server',
noBackdrop: true,
duration: 2000
});
});
});