File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,40 @@ import {Animation} from '../../animations/animation';
19
19
* `dismiss` method. Additionally, you can dismiss any overlay by using `pop`
20
20
* on the root nav controller.
21
21
*
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
+ *
22
56
* A modal can also emit data, which is useful when it is used to add or edit
23
57
* data. For example, a profile page could slide up in a modal, and on submit,
24
58
* the submit button could pass the updated profile data, then dismiss the
You can’t perform that action at this time.
0 commit comments