{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic2/issues/906","labels_url":"https://api.github.com/repos/driftyco/ionic2/issues/906/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic2/issues/906/comments","events_url":"https://api.github.com/repos/driftyco/ionic2/issues/906/events","html_url":"https://github.com/driftyco/ionic2/issues/906","id":125769651,"number":906,"title":"Passing parameters to a modal","user":{"login":"mhartington","id":2835826,"avatar_url":"https://avatars.githubusercontent.com/u/2835826?v=3","gravatar_id":"","url":"https://api.github.com/users/mhartington","html_url":"https://github.com/mhartington","followers_url":"https://api.github.com/users/mhartington/followers","following_url":"https://api.github.com/users/mhartington/following{/other_user}","gists_url":"https://api.github.com/users/mhartington/gists{/gist_id}","starred_url":"https://api.github.com/users/mhartington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhartington/subscriptions","organizations_url":"https://api.github.com/users/mhartington/orgs","repos_url":"https://api.github.com/users/mhartington/repos","events_url":"https://api.github.com/users/mhartington/events{/privacy}","received_events_url":"https://api.github.com/users/mhartington/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/driftyco/ionic2/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-09T17:10:35Z","updated_at":"2016-01-10T03:16:12Z","closed_at":"2016-01-10T03:16:12Z","body":"Currently to pass parameters to a modal, you have to pass them in `Modal.create`\r\n\r\n```\r\n  presentModal(image) {\r\n   let viewerModal = Modal.create(Viewer, {\r\n     'image': image\r\n   });\r\n   this.nav.present(viewerModal);\r\n }\r\n```\r\n\r\nI feel like this should be done during present instead. Since we moved towards using `navCtrl` to show a modal, it feels more natural, like push a page with some data. \r\n\r\n```\r\n  presentModal(image) {\r\n   let viewerModal = Modal.create(Viewer);\r\n   this.nav.present(viewerModal, , {\r\n     'image': image\r\n   });\r\n }\r\n```\r\n\r\nThoughts? "},"comment":{"url":"https://api.github.com/repos/driftyco/ionic2/issues/comments/170306117","html_url":"https://github.com/driftyco/ionic2/issues/906#issuecomment-170306117","issue_url":"https://api.github.com/repos/driftyco/ionic2/issues/906","id":170306117,"user":{"login":"adamdbradley","id":452425,"avatar_url":"https://avatars.githubusercontent.com/u/452425?v=3","gravatar_id":"","url":"https://api.github.com/users/adamdbradley","html_url":"https://github.com/adamdbradley","followers_url":"https://api.github.com/users/adamdbradley/followers","following_url":"https://api.github.com/users/adamdbradley/following{/other_user}","gists_url":"https://api.github.com/users/adamdbradley/gists{/gist_id}","starred_url":"https://api.github.com/users/adamdbradley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamdbradley/subscriptions","organizations_url":"https://api.github.com/users/adamdbradley/orgs","repos_url":"https://api.github.com/users/adamdbradley/repos","events_url":"https://api.github.com/users/adamdbradley/events{/privacy}","received_events_url":"https://api.github.com/users/adamdbradley/received_events","type":"User","site_admin":false},"created_at":"2016-01-10T03:16:12Z","updated_at":"2016-01-10T03:16:12Z","body":"With `present` your giving the nav a `ViewController` instance, which has the component class and param data. With `push` you're giving it a component class with param data. Under the hood, `push` is doing the same thing where creates a ViewController from a component class and param data, it doesn't separate them.\r\n\r\nWith overlays, we want to immediately have a reference to the instance of the `Alert`, `ActionSheet` and `Modal`. This way they can take a completed instance and change it up as they please, close it the millisecond is starts to animate in, etc. \r\n\r\nOf we did break them apart where the View controller instance really was just an instance, but without any data, it would make things more difficult. Also present is for more than just modal. For example, our `Alert` and `ActionSheet` wouldn't be able to do this:\r\n\r\n```\r\nlet alert = Alert.create();\r\nalert.setTitle('My Title');\r\nthis.nav.present(alert);\r\n```\r\n\r\nI think the way it is now allows us to be more flexible."}}