APSList.controller.js 844 Bytes
Newer Older
Thitichaipun Wutthisak committed
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
'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;
		
	}
}]);