From 4f9a639b0576de16335ea64b6857ab9ecff6f09a Mon Sep 17 00:00:00 2001 From: Drew Rygh Date: Tue, 8 Dec 2015 11:20:56 -0600 Subject: [PATCH 1/2] docs(demos): nav param demo --- demos/nav-params/app.html | 2 ++ demos/nav-params/index.ts | 41 ++++++++++++++++++++++++++++++++++++ demos/nav-params/main.html | 14 ++++++++++++ demos/nav-params/page-2.html | 7 ++++++ 4 files changed, 64 insertions(+) create mode 100644 demos/nav-params/app.html create mode 100644 demos/nav-params/index.ts create mode 100644 demos/nav-params/main.html create mode 100644 demos/nav-params/page-2.html diff --git a/demos/nav-params/app.html b/demos/nav-params/app.html new file mode 100644 index 0000000000..5f6bb33d68 --- /dev/null +++ b/demos/nav-params/app.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/demos/nav-params/index.ts b/demos/nav-params/index.ts new file mode 100644 index 0000000000..6330c786b8 --- /dev/null +++ b/demos/nav-params/index.ts @@ -0,0 +1,41 @@ +import {App, Page, IonicApp, Config, Platform} from 'ionic/ionic'; +import {NavController, NavParams} from 'ionic/ionic'; + + +@App({ + templateUrl: 'app.html' +}) +class ApiDemoApp { + + constructor() { + this.rootPage = InitialPage; + } +} + +@Page({ + templateUrl: 'main.html' +}) +export class InitialPage { + constructor(nav: NavController) { + this.nav = nav; + this.myParam = ''; + } + + pushParams() { + this.nav.push(Page2, { 'myParam': this.myParam }); + } +} + +@Page({ + templateUrl: "page-2.html" +}) +export class Page2 { + constructor( + nav: NavController, + params: NavParams + ) { + this.nav = nav; + this.myParam = params.get('myParam'); + } +} + diff --git a/demos/nav-params/main.html b/demos/nav-params/main.html new file mode 100644 index 0000000000..0a74f8923d --- /dev/null +++ b/demos/nav-params/main.html @@ -0,0 +1,14 @@ + + Nav Params + + + + + + + + + + + + diff --git a/demos/nav-params/page-2.html b/demos/nav-params/page-2.html new file mode 100644 index 0000000000..db862a8a57 --- /dev/null +++ b/demos/nav-params/page-2.html @@ -0,0 +1,7 @@ + + Modals + + + +
Parameters entered: {{myParam}}
+
From 91d8b3f43fd9272c22161f2762274040c9392658 Mon Sep 17 00:00:00 2001 From: Drew Rygh Date: Tue, 8 Dec 2015 11:49:44 -0600 Subject: [PATCH 2/2] docs(nav-controller): add related, demo links --- ionic/components/nav/nav-controller.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ionic/components/nav/nav-controller.ts b/ionic/components/nav/nav-controller.ts index 9a05e6bd47..b8194b546a 100644 --- a/ionic/components/nav/nav-controller.ts +++ b/ionic/components/nav/nav-controller.ts @@ -1472,7 +1472,11 @@ let ctrlIds = -1; * } * } * ``` - * + * @demo /docs/v2/demos/nav-params/ + * @see {@link /docs/v2/components#navigation Navigation Component Docs} + * @see {@link ../NavController/ NavController API Docs} + * @see {@link ../Nav/ Nav API Docs} + * @see {@link ../NavPush/ NavPush API Docs} */ export class NavParams { /**