{"size": 697, "ext": "js", "max_stars_repo_path": "src/app/components/route/routeDeleteCtrl.js", "max_stars_repo_name": "uktrade/cf-webui", "max_stars_repo_stars_event_min_datetime": "2015-05-05T15:46:52.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-14T19:43:18.000Z", "max_issues_repo_path": "src/app/components/route/routeDeleteCtrl.js", "max_issues_repo_name": "uktrade/cf-webui", "max_issues_repo_issues_event_min_datetime": "2016-03-07T15:51:22.000Z", "max_issues_repo_issues_event_max_datetime": "2019-03-05T13:13:04.000Z", "max_forks_repo_path": "src/app/components/route/routeDeleteCtrl.js", "max_forks_repo_name": "uktrade/cf-webui", "max_forks_repo_forks_event_min_datetime": "2015-08-18T11:51:25.000Z", "max_forks_repo_forks_event_max_datetime": "2019-06-03T05:46:12.000Z"}
{"max_stars_count": 68, "max_issues_count": 14, "max_forks_count": 33, "avg_line_length": 43.5625, "max_line_length": 220, "alphanum_fraction": 0.668579627}
angular.module('app.routes').controller('RouteDeleteCtrl', ['$scope', '$modalInstance', '$log', 'routeId', 'routeService', 'messageService', function($scope, $modalInstance, $log, routeId, routeService, messageService) {
  $scope.ok = function () {
    routeService.deleteRoute(routeId).then(function(response) {
      messageService.addMessage('success', 'The route has been successfully deleted.');
      $modalInstance.close(routeId);
    }, function(err) {
      messageService.addMessage('danger', 'The route has not been deleted.');
      $log.error(err);
      $modalInstance.dismiss('cancel');
    });
  };
  
  $scope.cancel = function () {
    $modalInstance.dismiss('cancel');
  };
}]);