Modified blank screen controller to use scope directly

This commit is contained in:
Jesús Ángel González 2018-03-11 12:16:50 +01:00
parent 1a21504b36
commit eee3c24215

View File

@ -1,11 +1,13 @@
const app = require('ui/modules').get('app/wazuh', []); const app = require('ui/modules').get('app/wazuh', []);
import $ from 'jquery';
// Logs controller // Logs controller
app.controller('blankScreenController', function ($scope, $rootScope, errorHandler) { app.controller('blankScreenController', function ($scope, $rootScope, errorHandler,$location) {
if($rootScope.blankScreenError) { if($rootScope.blankScreenError) {
$('#result').html(errorHandler.handle($rootScope.blankScreenError,'',false,true)); $scope.errorToShow = $rootScope.blankScreenError;
delete $rootScope.blankScreenError; delete $rootScope.blankScreenError;
} else { if(!$scope.$$phase) $scope.$digest();
$('#result').html('Something went wrong') }
$scope.goOverview = () => {
$location.path('/overview');
} }
}); });