diff --git a/www/js/controllers.js b/www/js/controllers.js index 41fb13d..c4cb6dd 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -80,6 +80,10 @@ angular.module('treephone.controllers', []) }) .controller('FriendDetailCtrl', function($scope, $stateParams, Friends) { + $scope.invite = function () { + Friends.invite($stateParams.friendId); + // TODO: pop up a modal + } Friends.get($stateParams.friendId).then( function (friend) { console.log(friend); diff --git a/www/js/services.js b/www/js/services.js index 8641d59..a4eca45 100644 --- a/www/js/services.js +++ b/www/js/services.js @@ -139,6 +139,21 @@ angular.module('treephone.services', []) function () { return {};} ); return promise; - } + }, + + invite: function(friendId) { + var req = { + method: 'GET', + url: api_root + '/users/' + friendId + '/invite', + headers: Auth.getHeaders() + }; + var promise = $http(req) + .then( + function () { return {};}, + function () { return {};} + ); + return promise; + }, + } }); diff --git a/www/templates/friend-detail.html b/www/templates/friend-detail.html index 976fd72..9609f41 100644 --- a/www/templates/friend-detail.html +++ b/www/templates/friend-detail.html @@ -18,5 +18,8 @@

{{friend.first_name}} has {{friend.outdegree}} direct contacts and {{friend.network_size}} people in their network.

+
+
+