'use strict';

var UnpostedCtrl = ['$scope', 'info', 'Unposted', function ($scope, info, Unposted) {
    $scope.info = info;
    $scope.refresh = function () {
        Unposted.query({}, function (result) {
            $scope.info = result;
            $scope.apply();
        });
    }
}]
UnpostedCtrl.resolve = {
    info:['$q', 'Unposted', function ($q, Unposted) {
        var deferred = $q.defer();

        var successCb = function (result) {
            deferred.resolve(result);
        };

        Unposted.query({}, successCb);
        return deferred.promise;
    }]
}