From 7a4f2ea3b18e1932ef95c27832740c7ab7be6c6d Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Mon, 5 Oct 2015 10:50:01 -0500 Subject: [PATCH] feat(nav-push): NavPush api docs --- ionic/components/nav/nav-push.ts | 31 +++++++++++++++++++++++++++- ionic/components/nav/nav-registry.ts | 1 + 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ionic/components/nav/nav-push.ts b/ionic/components/nav/nav-push.ts index 2f6e5def7b..a37ec30a79 100644 --- a/ionic/components/nav/nav-push.ts +++ b/ionic/components/nav/nav-push.ts @@ -3,7 +3,36 @@ import {NavController} from './nav-controller'; import {NavRegistry} from './nav-registry'; /** - * TODO + * Directive for declaratively linking to a new view instead of using + * [NavController.push()](../NavController/#push). Similar to ui-router's `ui-sref`. + * + * Basic usage: + * ```html + * + * ``` + * To specify parameters you can use array syntax or the `nav-params` property: + * ```html + * + * ``` + * Where `pushPage` and `params` are specified in your component: + * ```ts + * import {LoginPage} from 'login'; + * @IonicView({ + * template: `` + * }) + * class MyPage { + * constructor(){ + * this.pushPage = LoginPage; + * this.params = { id: 42 }; + * } + * } + * ``` + * + * ### Alternate syntax + * You can also use syntax similar to Angular2's router, passing an array to NavPush: + * ```html + * + * ``` */ @Directive({ selector: '[nav-push]', diff --git a/ionic/components/nav/nav-registry.ts b/ionic/components/nav/nav-registry.ts index b389dad071..890cb86a90 100644 --- a/ionic/components/nav/nav-registry.ts +++ b/ionic/components/nav/nav-registry.ts @@ -1,5 +1,6 @@ /** + * @private * Map of possible views that can be navigated to using an Ionic NavController */ export class NavRegistry {