{"size": 994, "ext": "js", "max_stars_repo_path": "www/js/ctrl/dashboardCtrl.js", "max_stars_repo_name": "joewashear007/CatHACKlic", "max_stars_repo_stars_event_min_datetime": "2019-07-30T03:03:00.000Z", "max_stars_repo_stars_event_max_datetime": "2019-07-30T03:03:00.000Z", "max_issues_repo_path": "www/js/ctrl/dashboardCtrl.js", "max_issues_repo_name": "joewashear007/CatHACKlic", "max_issues_repo_issues_event_min_datetime": "2015-03-13T03:06:27.000Z", "max_issues_repo_issues_event_max_datetime": "2015-03-29T16:11:40.000Z", "max_forks_repo_path": "www/js/ctrl/dashboardCtrl.js", "max_forks_repo_name": "joewashear007/CatHACKlic", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 17, "max_forks_count": null, "avg_line_length": 28.4, "max_line_length": 99, "alphanum_fraction": 0.6539235412}
angular.module('cathacklic')

.controller('Dashboard.Ctrl', function($scope, $state, $ionicLoading, DBAccessor, ExamineService) {
  $scope.PastExamines = null;
  $scope.DoExamin = function(){
    $state.go("app.exam.baker");
  };


  $scope.GetPrev = function(){
    $scope.Loading = ExamineService.ListExaminations().then(function(data){
      $scope.PastExamines = data;
      console.log("Done Loading data.");
    }, function(err){
      console.warn(err);
    });
  };

  $scope.ClearData = function(){
    var DBDeleteRequest = indexedDB.deleteDatabase("BAKER.Examination");
    DBDeleteRequest.onerror = function(event) { alert("Error deleting database."); };
    DBDeleteRequest.onsuccess = function(event) { alert("Database deleted successfully"); };

    ExamineService.ClearData(function(err, data){
      if(err){
        console.warn("Error deleting database.", err);
      }else{
        console.log("Database deleted successfully");
      }
    });
  };

  $scope.GetPrev();
});
