File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,48 @@ import {Animation} from '../../animations/animation';
18
18
* modal can later be closed or "dismissed" by using the ViewController's
19
19
* `dismiss` method. Additionally, you can dismiss any overlay by using `pop`
20
20
* on the root nav controller.
21
+ *
22
+ * Data can be passed in through the Modal.Create() function as a second argument.
23
+ * This data is available in the modal on the ViewController object as the parameter
24
+ * "data".
25
+ *
26
+ * * @usage
27
+ * ```ts
28
+ * import {Modal, NavController, ViewController} from 'ionic/ionic';
29
+ *
30
+ * @Page (...)
31
+ * class HomePage {
32
+ *
33
+ * constructor(nav: NavController) {
34
+ * this.nav = nav;
35
+ * }
36
+ *
37
+ * presentProfileModal() {
38
+ * let profileModal = Modal.create(Profile, { userId: 8675309 });
39
+ * this.nav.present(profileModal);
40
+ * }
41
+ *
42
+ * }
43
+ *
44
+ * @Page (...)
45
+ * class Profile {
46
+ *
47
+ * constructor(viewCtrl: ViewController) {
48
+ * this.viewCtrl = viewCtrl;
49
+ * }
50
+ *
51
+ * grabData() {
52
+ * let passedData = this.viewCtrl.data;
53
+ * }
54
+ *
55
+ * dismiss() {
56
+ * this.viewCtrl.dismiss();
57
+ * }
58
+ *
59
+ * }
60
+ * ```
61
+ *
62
+ *
21
63
*
22
64
* A modal can also emit data, which is useful when it is used to add or edit
23
65
* data. For example, a profile page could slide up in a modal, and on submit,
You can’t perform that action at this time.
0 commit comments