summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-FE-common/client/app/views/errors/error.controller.js
blob: 5f4f410d099472ed28971b1d2ec4e1a223fb314d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'use strict';
(function () {
    class ErrorCtrl {
        constructor($log, $scope,$state) {
        	$scope.errorState = $state.current.name;
        	if($scope.errorState=='root.error404'){
        		$scope.errorTitle="Page Not Found";
        		$scope.errorMsg="The page you are looking for cannot be found";
        	}else if($scope.errorState=='noUserError'){
        		$scope.errorTitle="Authorization denied";
        		$scope.errorMsg= "Please Contact Your Administrator for the page access";
        	}else {
        		$scope.errorTitle="Something went wrong";
        		$scope.errorMsg= "Please go back to the previous page";
        	}	     	
        }
    }
    ErrorCtrl.$inject = ['$log','$scope','$state'];
    angular.module('ecompApp').controller('ErrorCtrl', ErrorCtrl);
})();