Last active
July 6, 2017 07:30
-
-
Save kscc25/529ae026be711066b0fce1a6431f4fa7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.controller('userDisplayController', function(followService) { | |
var self = this; | |
self.toggleFollow = toggleFollow; | |
self.isFollowing = followService.isFollowing(self.user); | |
function toggleFollow() { | |
if (isFollowing) { | |
followService.unfollow(self.user); | |
self.isFollowing = false; | |
} else { | |
followService.follow(self.user); | |
self.isFollowing = true; | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment