Skip to content

Commit 80a889e

Browse files
committed
Merge branch 'pr/5336' into 2.0
2 parents d23df42 + 702daa5 commit 80a889e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

ionic/components/modal/modal.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,40 @@ import {Animation} from '../../animations/animation';
1919
* `dismiss` method. Additionally, you can dismiss any overlay by using `pop`
2020
* on the root nav controller.
2121
*
22+
* Data can be passed to a new modal through `Modal.create()` as the second
23+
* argument. The data can gen be accessed from the opened page by injecting
24+
* `NavParams`. Note that the page, which opened as a modal, has no special
25+
* "modal" logic within it, but uses `NavParams` no differently than a
26+
* standard page.
27+
*
28+
* * @usage
29+
* ```ts
30+
* import {Modal, NavController, NavParams} from 'ionic/ionic';
31+
*
32+
* @Page(...)
33+
* class HomePage {
34+
*
35+
* constructor(nav: NavController) {
36+
* this.nav = nav;
37+
* }
38+
*
39+
* presentProfileModal() {
40+
* let profileModal = Modal.create(Profile, { userId: 8675309 });
41+
* this.nav.present(profileModal);
42+
* }
43+
*
44+
* }
45+
*
46+
* @Page(...)
47+
* class Profile {
48+
*
49+
* constructor(params: NavParams) {
50+
* console.log('UserId', params.get('userId'));
51+
* }
52+
*
53+
* }
54+
* ```
55+
*
2256
* A modal can also emit data, which is useful when it is used to add or edit
2357
* data. For example, a profile page could slide up in a modal, and on submit,
2458
* the submit button could pass the updated profile data, then dismiss the

0 commit comments

Comments
 (0)