Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(modal): add docs for using nav in modal #12747

Merged
merged 1 commit into from
Sep 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/components/modal/modal-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,25 @@ import { DeepLinker } from '../../navigation/deep-linker';
*
* }
* ```
*
* A common issue is that a developer may try to implement navigation in a modal, but when you try NavController.push(),
* you will notice that the status bar on iOS gets cut off. The proper way to implement navigation in a modal is to
* make the modal component a navigation container, and set the root page to the page you want to show in your modal.
*
* ```ts
* @Component({
* template: '<ion-nav [root]="rootPage" [rootParams]="rootParams"></ion-nav>'
* })
* export class MyModalWrapper {
* rootPage = 'MyModalContentPage'; // This is the page you want your modal to display
* rootParams;
*
* constructor(navParams: NavParams, private viewCtrl: ViewController) {
* this.rootParams = Object.assign({}, navParams.data, {viewCtrl: viewCtrl});
* // This line will send the view controller into your child views, so you can dismiss the modals from there.
* }
* }
* ```
* @demo /docs/demos/src/modal/
* @see {@link /docs/components#modals Modal Component Docs}
*/
Expand Down