'use strict'; angular.module('aps_manager').controller('APSList', ['$scope', '$http', 'APSRest', '$state', '$stateParams', function($scope, $http, APSRest, $state, $stateParams){ $scope.aps_type = $stateParams.aps_type; $scope.employeedata = []; $scope.link =""; APSRest.APSList.query({ aps_type: $scope.aps_type }) .$promise.then(function(data){ $scope.employeedata = data.ObjectiveEmp; console.log($scope.employeedata); }) $scope.redirectLink = function(apsassessy,apsassessor,apsid){ if ($scope.aps_type == "PAT"){ $scope.link ="APP_PAT.jsp" }else if ($scope.aps_type == "PAE"){ $scope.link ="APP_PAE.jsp" }else if ($scope.aps_type == "CKW"){ $scope.link ="APP_CKW.jsp" } $scope.link +="?apsassessor="+apsassessor+"&apsassessy="+apsassessy+"&apsid="+apsid; window.location.href=$scope.link; } }]);