arnaucube
arnaucube/commonroutesAppPublic Self-hosted repository
commonroutesApp/www/js/notifications.js
www/js/notifications.jsRaw
 1angular.module('app.notifications', ['pascalprecht.translate'])
 2
 3.controller('NotificationsCtrl', function($scope, $stateParams, $translate, $filter) {
 4  if(localStorage.getItem('c_token')){// adding token to the headers
 5    //  $http.defaults.headers.common['X-Access-Token'] = localStorage.getItem('c_token');
 6  }
 7  $scope.storageusername=localStorage.getItem("c_username");
 8  $scope.users= JSON.parse(localStorage.getItem('c_users'));
 9  $scope.user = $filter('filter')($scope.users, {username: $stateParams.username}, true)[0];
10  $scope.notifications=$scope.user.notifications;
11
12  console.log($stateParams.username);
13  console.log($scope.notifications);
14  console.log("notifications page");
15});