text: var app = angular.module("ive");
  
  // Scenario delete controller
  app.controller("scenarioDeleteController", function($scope, $rootScope, $routeParams, $filter, $translate, $location, config, $window, $authenticationService, $scenarioService) {
  
      /*************************************************
          FUNCTIONS
       *************************************************/
  
      /**
       * [redirect description]
       * @param  {[type]} path [description]
       * @return {[type]}      [description]
       */
      $scope.redirect = function(path){
          $location.url(path);
      };
  
      /**
       * [delete description]
       * @return {[type]} [description]
       */
      $scope.delete = function(){
          $scope.$parent.loading = { status: true, message: $filter('translate')('DELETING_SCENARIO') };
  
          $scenarioService.remove($scope.scenario.scenario_id)
          .then(function onSuccess(response) {
              $scope.redirect("/scenarios");
          })
          .catch(function onError(response) {
              $window.alert(response.data);
          });
      };
  
      /*************************************************
          INIT
       *************************************************/
      $scope.$parent.loading = { status: true, message: $filter('translate')('LOADING_SCENARIO') };
      $scope.input = "";
  
      // Load scenario
      $scenarioService.retrieve($routeParams.scenario_id)
      .then(function onSuccess(response) {
          $scope.scenario = response.data;
          $scope.$parent.loading = { status: false, message: "" };
      })
      .catch(function onError(response) {
          $window.alert(response.data);
      });
  
  });
  