mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
Routing with lifecycles
This commit is contained in:
@ -159,12 +159,19 @@ export class Routable {
|
||||
this.componentClass = componentClass;
|
||||
this.routeInfo = routeInfo;
|
||||
|
||||
console.log('New routable', componentClass, routeInfo);
|
||||
//console.log('New routable', componentClass, routeInfo);
|
||||
|
||||
componentClass.router = this;
|
||||
}
|
||||
invoke(componentInstance) {
|
||||
console.log('Routable invoke', componentInstance);
|
||||
// Called on viewLoaded
|
||||
|
||||
// Bind some lifecycle events
|
||||
componentInstance._viewWillEnter.observer({
|
||||
next: () => {
|
||||
Router.emit(this.routeInfo.url);
|
||||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user