From ec0c146be6cb56734f6b70f8d8172fcfb0d849b8 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Tue, 8 Dec 2015 22:00:55 -0600 Subject: [PATCH] fix(router): create custom ResolvedInstruction class --- ionic/components/nav/nav-router.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ionic/components/nav/nav-router.ts b/ionic/components/nav/nav-router.ts index fe7d0385bd..a7c17beac1 100644 --- a/ionic/components/nav/nav-router.ts +++ b/ionic/components/nav/nav-router.ts @@ -84,8 +84,8 @@ export class NavRouter extends RouterOutlet { // generate a componentInstruction from the view's PathRecognizer and params let componentInstruction = pathRecognizer.generate(viewCtrl.params.data); - // create an Instruction from the componentInstruction - let instruction = new Instruction(componentInstruction, null); + // create a ResolvedInstruction from the componentInstruction + let instruction = new ResolvedInstruction(componentInstruction, null); this._parentRouter.navigateByInstruction(instruction); } @@ -113,3 +113,16 @@ export class NavRouter extends RouterOutlet { } } + +// TODO: hacked from +// https://github.com/angular/angular/blob/6ddfff5cd59aac9099aa6da5118c5598eea7ea11/modules/angular2/src/router/instruction.ts#L207 +class ResolvedInstruction extends Instruction { + constructor(public component: ComponentInstruction, public child: Instruction, + public auxInstruction: {[key: string]: Instruction}) { + super(); + } + + resolveComponent(): Promise { + return Promise.resolve(this.component); + } +}