"use strict";

appCore.controller("ManagerListCtrl", ["$state", "$scope", "$http", "$timeout", "vServices", "filterFilter", function ($state, $scope, $http, $timeout, vServices, filterFilter) {
  $scope.heroes = [];
  $scope.$root.page.title = "List of Managers";
  $scope.poolStatus = (level) => {
    return level > 50 ? "badge-danger" : level > 20 ? "badge-warning" : "badge-success";
  };

  const init = function () {
    vServices.callApi("employee/manager/all", "GET", {}).then(function (res) {
      if (res && res.length > 0) {
        $scope.heroes = res;
        $scope.$root.callDataTable("#managerList");
      }
    });
  };
  init();
}]);
