From 962f7ea522a6c19660f1deaf20d6f5cd56ac69a4 Mon Sep 17 00:00:00 2001 From: Shank Date: Fri, 13 Jul 2018 12:10:54 -0700 Subject: [PATCH] docs(breaking): add breaking change to modal create method arguments (#14756) * Add changes in modal to breaking change doc * fixes to new usage --- angular/BREAKING.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/angular/BREAKING.md b/angular/BREAKING.md index b1278d6d6b..80591e1966 100644 --- a/angular/BREAKING.md +++ b/angular/BREAKING.md @@ -23,6 +23,7 @@ A list of the breaking changes introduced in Ionic Angular v4. - [Label](#label) - [List Header](#list-header) - [Menu Toggle](#menu-toggle) +- [Modal](#modal) - [Nav](#nav) - [Navbar](#navbar) - [Option](#option) @@ -763,6 +764,47 @@ The `menuToggle` attribute should not be added to an element anymore. Elements t ``` +## Modal + +### Arguments Changed + +The component is no longer the first argument in the `create` method. Instead, a single argument of type `ModalOptions` is passed in with a `component` property and the value is the component as part of the passed object. + +**Old Usage Example:** + +```javascript +import { ModalController } from 'ionic-angular'; +import { ModalPage } from './modal-page'; + +export class MyPage { + + constructor(public modalCtrl: ModalController) { } + + presentModal() { + const modal = this.modalCtrl.create(ModalPage); + modal.present(); + } +} +``` + +**New Usage Example:** + +```javascript +import { ModalController } from 'ionic-angular'; +import { ModalPage } from './modal-page'; + +export class MyPage { + + constructor(public modalCtrl: ModalController) { } + + async presentModal() { + const modal = this.modalCtrl.create({ + component: ModalPage + }); + return modal.present(); + } +} +``` ## Nav