# Pastebin uNhO0R2S angular.module('prioritizeApp').service('departmentListService', ['$http','departmentService','APIUrls', function ($http,departmentService,APIUrls) { var service = this; this.departments = []; //get employee from db //loop through and add //this.employees.push(employeeService.Employee(emp)); service.refreshData = function () { $http.get(APIUrls.getUrl('departments')). success(function (data, status, headers, config) { for (var count in data) { service.departments.push(departmentService.Department(data[count])); } }); }; service.refreshData(); }