'use strict' angular.module('EXAM').controller('ExamList', ['$scope', '$http', 'GETLANG', 'EXAMSERVICES', function($scope, $http, GETLANG, EXAMSERVICES){ $scope.examlist = [] EXAMSERVICES.ManageExamList.query().$promise.then(function(result){ $scope.examlist = result.exam }) $scope.swlang = GETLANG $scope.getString = function(obj){ let str = ''; if (getLang() === 'eng'){ str = obj.eng } else if (getLang() === 'tha'){ str = obj.tha } return str } $scope.goPage = function(exid){ angular.element($('input[name="__examid"]').val(exid)) $('form[name="cscform"]').submit() } $scope.sortByExamId = (exam) => { return parseInt(exam.examid) } $scope.orderByExamId = (exam) => { return parseInt(exam.examid) } }])