all files / js/employer/ employer.service.js

18.18% Statements 2/11
100% Branches 0/0
0% Functions 0/4
18.18% Lines 2/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31                                                         
/**
 * Created by cklimkowsky on 2/25/15.
 */
angular
    .module('coopEval')
    .service('employerService', employerService);
 
function employerService($http) {
 
    var urlBase = 'services';
 
    this.getPlacementData = function () {
        return $http.get(urlBase + '/EvaluationService/getEmployerOverview');
    };
 
    this.login = function (credentials) {
        return $http({
            method: 'POST',
            url: urlBase + '/AuthenticationService/authenticateEmployer',
            headers: {'Content-Type': 'application/x-www-form-urlencoded'},
            transformRequest: function (obj) {
                var str = [];
                for (var p in obj)
                    str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
                return str.join("&");
            },
            data: credentials
        })
    }
 
}