Remove unused StateController.previousName

Change-type: patch
This commit is contained in:
Alexis Svinartchouk 2020-01-03 11:46:55 +01:00 committed by Lorenzo Alberto Maria Ambrosi
parent 315051c14c
commit 146bfaa9de

View File

@ -409,26 +409,11 @@ app.config(($locationProvider) => {
app.controller('StateController', function ($rootScope, $scope) {
const unregisterStateChange = $rootScope.$on('$stateChangeSuccess', (event, toState, toParams, fromState) => {
this.previousName = fromState.name
this.currentName = toState.name
})
$scope.$on('$destroy', unregisterStateChange)
/**
* @summary Get the previous state name
* @function
* @public
*
* @returns {String} previous state name
*
* @example
* if (StateController.previousName === 'main') {
* console.log('We left the main screen!');
* }
*/
this.previousName = null
/**
* @summary Get the current state name
* @function