From 6fac5ff7fcf584e4f269fff66ca0104b26fc67b3 Mon Sep 17 00:00:00 2001 From: Mike Hartington Date: Wed, 1 Apr 2020 10:13:43 -0400 Subject: [PATCH] docs(modal): remove navParams usage --- core/src/components/modal/readme.md | 15 ++++----------- core/src/components/modal/usage/angular.md | 15 ++++----------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/core/src/components/modal/readme.md b/core/src/components/modal/readme.md index 7c43031387..dc23e86d2f 100644 --- a/core/src/components/modal/readme.md +++ b/core/src/components/modal/readme.md @@ -40,23 +40,21 @@ export class ModalExample { ```typescript import { Component, Input } from '@angular/core'; -import { NavParams } from '@ionic/angular'; @Component({ selector: 'modal-page', }) export class ModalPage { - constructor() { - - } + constructor() {} } ``` ### Passing Data -During creation of a modal, data can be passed in through the `componentProps`. The previous example can be written to include data: +During creation of a modal, data can be passed in through the `componentProps`. +The previous example can be written to include data: ```typescript async presentModal() { @@ -72,7 +70,7 @@ async presentModal() { } ``` -To get the data passed into the `componentProps`, either set it as an `@Input` or access it via `NavParams` on the `ModalPage`: +To get the data passed into the `componentProps`, set it as an `@Input`: ```typescript export class ModalPage { @@ -82,11 +80,6 @@ export class ModalPage { @Input() lastName: string; @Input() middleInitial: string; - constructor(navParams: NavParams) { - // componentProps can also be accessed at construction time using NavParams - console.log(navParams.get('firstName')); - } - } ``` diff --git a/core/src/components/modal/usage/angular.md b/core/src/components/modal/usage/angular.md index 68425978a6..3998fb5464 100644 --- a/core/src/components/modal/usage/angular.md +++ b/core/src/components/modal/usage/angular.md @@ -24,23 +24,21 @@ export class ModalExample { ```typescript import { Component, Input } from '@angular/core'; -import { NavParams } from '@ionic/angular'; @Component({ selector: 'modal-page', }) export class ModalPage { - constructor() { - - } + constructor() {} } ``` ### Passing Data -During creation of a modal, data can be passed in through the `componentProps`. The previous example can be written to include data: +During creation of a modal, data can be passed in through the `componentProps`. +The previous example can be written to include data: ```typescript async presentModal() { @@ -56,7 +54,7 @@ async presentModal() { } ``` -To get the data passed into the `componentProps`, either set it as an `@Input` or access it via `NavParams` on the `ModalPage`: +To get the data passed into the `componentProps`, set it as an `@Input`: ```typescript export class ModalPage { @@ -66,11 +64,6 @@ export class ModalPage { @Input() lastName: string; @Input() middleInitial: string; - constructor(navParams: NavParams) { - // componentProps can also be accessed at construction time using NavParams - console.log(navParams.get('firstName')); - } - } ```