getEvents by following users, and some pages

This commit is contained in:
arnaucode
2017-02-25 12:58:13 +01:00
parent 2dc2105948
commit baa74e1921
14 changed files with 117 additions and 28 deletions

View File

@@ -33,12 +33,12 @@ angular.module('app.users', ['pascalprecht.translate'])
}
});
$scope.followUser = function(user){
$scope.followingUsers.push(user);
$scope.followingUsers.push(user._id);
localStorage.setItem("events_app_followingUsers", JSON.stringify($scope.followingUsers));
};
$scope.unfollowUser = function(user){
for(var i=0; i<$scope.followingUsers.length; i++) {
if ($scope.followingUsers[i]._id === user._id){
if ($scope.followingUsers[i] === user._id){
$scope.followingUsers.splice(i, 1);
}
}
@@ -46,7 +46,7 @@ angular.module('app.users', ['pascalprecht.translate'])
};
$scope.isUserFollowed = function(user) {
for(var i=0; i<$scope.followingUsers.length; i++) {
if ($scope.followingUsers[i]._id === user._id){
if ($scope.followingUsers[i] === user._id){
return true;
}
}