Source Code: (back to article)
angular.module('MyModule')
.controller('MyController', ['$scope', 'MyService', function($scope, MyService){
$scope.users = MyService.users // some items inside array
$scope.deleteUserFriend = function(userId, friendId){
if(userId && friendId){
MyService.deleteUserFriend(userId, friendId)
.success(function(res, ...){
// on success function
})
.error(function(res, ...){
// on error function
})
}

...
}
}])