mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
@@ -183,23 +183,6 @@ export class ViewController {
|
||||
return (this.index === 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
addDestroy(destroyFn: Function) {
|
||||
this._destroys.push(destroyFn);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
destroy() {
|
||||
for (var i = 0; i < this._destroys.length; i++) {
|
||||
this._destroys[i]();
|
||||
}
|
||||
this._destroys = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@@ -489,10 +472,21 @@ export class ViewController {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* The view has been destroyed and its elements have been removed.
|
||||
*/
|
||||
didUnload() {
|
||||
addDestroy(destroyFn: Function) {
|
||||
this._destroys.push(destroyFn);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
destroy() {
|
||||
ctrlFn(this, 'onPageDidUnload');
|
||||
|
||||
for (var i = 0; i < this._destroys.length; i++) {
|
||||
this._destroys[i]();
|
||||
}
|
||||
this._destroys = [];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user