Code coverage report for ./src/client/app/core/dataservice.js

Statements: 57.14% (8 / 14)      Branches: 100% (0 / 0)      Functions: 16.67% (1 / 6)      Lines: 61.54% (8 / 13)      Ignored: none     

All files » ./src/client/app/core/ » dataservice.js
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 32 33 34 351     1       1   1               1   1         1       1            
(function () {
    'use strict';
 
    angular
        .module('app.core')
        .factory('dataservice', dataservice);
 
    dataservice.$inject = ['$http', '$q', 'exception', 'logger'];
    /* @ngInject */
    function dataservice($http, $q, exception, logger) {
        var service = {
            getPeople: getPeople,
            getMessageCount: getMessageCount
        };
 
        return service;
 
        function getMessageCount() { return $q.when(72); }
 
        function getPeople() {
            return $http.get('/api/people')
                .then(success)
                .catch(fail);
 
            function success(response) {
                return response.data;
            }
 
            function fail(e) {
                return exception.catcher('XHR Failed for getPeople')(e);
            }
        }
    }
})();