diff --git a/ionic/components/nav/nav-push.ts b/ionic/components/nav/nav-push.ts index 3917283d6d..c592978998 100644 --- a/ionic/components/nav/nav-push.ts +++ b/ionic/components/nav/nav-push.ts @@ -7,7 +7,8 @@ import {NavController} from './nav-controller'; @Directive({ selector: '[nav-push]', properties: [ - 'navInstructions: navPush' + 'instruction: navPush', + 'params: navParams' ], host: { '(click)': 'onClick($event)', @@ -23,23 +24,15 @@ export class NavPush { this.nav = nav; } - set navInstructions(instructions) { - if (instructions instanceof Array) { - if (instructions.length > 2) { + onClick(event) { + if (this.instruction instanceof Array) { + if (this.instruction.length > 2) { throw 'Too many [nav-push] arguments, expects [View, { params }]' } - this.destination = instructions[0]; - this.navParams = instructions[1]; + this.nav.push(this.instruction[0], this.instruction[1]); } else { - this.destination = instructions; + this.nav.push(this.instruction, this.params); } - - //let annotations = Reflect.getMetadata('annotations', view); - // TODO check to make sure destination is a Component/IonicView? - } - - onClick(event) { - this.nav.push(this.destination, this.navParams); } } diff --git a/ionic/components/nav/test/basic/index.ts b/ionic/components/nav/test/basic/index.ts index a3e2a27396..7f0c1a7021 100644 --- a/ionic/components/nav/test/basic/index.ts +++ b/ionic/components/nav/test/basic/index.ts @@ -17,7 +17,8 @@ import {NavParams, NavController} from 'ionic/ionic'; '' + '

{{title}}

' + '

' + - '

' + + '

' + + '

' + '

' + '' + '' +