mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
docs(modal): add example of nested ionNav in modal
This commit is contained in:
committed by
Mike Hartington
parent
7e8bd5a8fe
commit
4f49f27824
@@ -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}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user