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}}
+
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 { /**