
angular.module('HealthFactors', [])
.service('HealthFactors', ['$http', '$rootScope',
function($http, $rootScope){

    const self = this;

    this.data;

    this.getHealthFactors = () => {

        return $http.get('../data/healthfactors.json').then(res => {

            self.data = res.data.rows;

            return self.data;
        })
    }

    this.getHealthFactor = (id) => {
        return self.data.filter(row => row.id === id)
    }
}])