@@ -18,14 +18,16 @@ 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
- *
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
+ *
26
28
* * @usage
27
29
* ```ts
28
- * import {Modal, NavController, ViewController } from 'ionic/ionic';
30
+ * import {Modal, NavController, NavParams } from 'ionic/ionic';
29
31
*
30
32
* @Page (...)
31
33
* class HomePage {
@@ -44,22 +46,12 @@ import {Animation} from '../../animations/animation';
44
46
* @Page (...)
45
47
* class Profile {
46
48
*
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();
49
+ * constructor(params: NavParams) {
50
+ * console.log('UserId', params.get('userId'));
57
51
* }
58
52
*
59
53
* }
60
54
* ```
61
- *
62
- *
63
55
*
64
56
* A modal can also emit data, which is useful when it is used to add or edit
65
57
* data. For example, a profile page could slide up in a modal, and on submit,
0 commit comments