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