mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
app state destroys itself when the route changes
This commit is contained in:
parent
3077ace5b4
commit
82870ec4a4
1 changed files with 4 additions and 2 deletions
|
@ -1,14 +1,16 @@
|
|||
define(function (require) {
|
||||
var _ = require('lodash');
|
||||
|
||||
return function AppStateProvider(Private) {
|
||||
return function AppStateProvider(Private, $rootScope) {
|
||||
var State = Private(require('components/state_management/state'));
|
||||
|
||||
_(AppState).inherits(State);
|
||||
function AppState(defaults) {
|
||||
AppState.Super.call(this, '_a', defaults);
|
||||
}
|
||||
|
||||
// When we have a route change, destroy the app state
|
||||
$rootScope.$on('$routeChangeStart', _.bindKey(this, 'destroy'));
|
||||
}
|
||||
|
||||
return AppState;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue