app.controller('MainCtrl', [ '$rootScope', '$scope', '$timeout', function($rootScope, $scope, $timeout) { if (!$rootScope.loginSuccess) return; $scope.showAppointment = false; $scope.showTicket = false; $scope.showInfo = false; $scope.hasFirstScore = false; $scope.hasFinalScore = false; $scope.getEnrolArray2 = function() { $rootScope.ajaxRequest({ url : '../enrol/std/enrol/list.htm' }, function(response) { $scope.EnrolArray2 = response.array; console.log(response.array); }); } $scope.getScoreArray = function() { var today = $rootScope.shortDateString(new Date()); var now = new Date(); $rootScope.ajaxRequest({ url : '../enrol/std/score/ym/final/list.htm' //data : {batch: "first"} }, function(response) { $rootScope.ScoreArray = response.array; for (var i=0;i