/**
 * Created by jaskokoyn on 4/26/2015.
 */
owlChatApp.controller("friendsCtrl",["$scope", "$rootScope", "$http", "$timeout", function($scope,$rootScope,$http,$timeout){
    $scope.friends              =   [];

    $('#friendsModal').on('shown.bs.modal', function () {
        $http({
            method: 'POST',
            url: 'actions/users/get-friends.php'
        }).success(function(data,status,headers,confiG){
            $scope.friends      =   [];

            data.friends.forEach(function(ele,ind,arr){
                $scope.friends.push(ele);
            });

            $timeout(function(){
                $(".btnTooltip").tooltip();
            }, 500);
        });
    });
}]);