mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 13:32:54 +08:00
refactor(overlays): inject overlay providers
BREAKING CHANGES: - Overlay components, such as Alert or Modals, should now be created using its injected provider. - Overlays now have the `present()` method on the overlay’s instance, rather than using `nav.present(overlayInstance)`. - All overlays now present on top of all app content, to include menus. - Below is an example of the change to `Alert`, but the pattern is the same for all overlays: ActionSheet, Loading, Modal, Picker, Popover, Toast WAS: ``` import { NavController, Alert } from ‘ionic-angular’; constructor(private nav: NavController) { } doAlert() { let alert = Alert.create({ title: 'Alert', }); this.nav.present(alert); } ``` NOW: ``` import { AlertController } from ‘ionic-angular’; constructor(private alertCtrl: AlertController) { } doAlert() { let alert = this.alertCtrl.create({ title: 'Alert' }); alert.present(); } ```
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
import { ChangeDetectorRef, EventEmitter, ElementRef, Output, Renderer } from '@angular/core';
|
||||
import { ChangeDetectorRef, ElementRef, EventEmitter, Output, Renderer } from '@angular/core';
|
||||
|
||||
import { Footer, Header } from '../toolbar/toolbar';
|
||||
import { isPresent, merge } from '../../util/util';
|
||||
import { Navbar } from '../navbar/navbar';
|
||||
import { NavController, NavOptions } from './nav-controller';
|
||||
import { NavController } from './nav-controller';
|
||||
import { NavOptions } from './nav-options';
|
||||
import { NavParams } from './nav-params';
|
||||
|
||||
|
||||
@ -79,11 +80,6 @@ export class ViewController {
|
||||
*/
|
||||
isOverlay: boolean = false;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
usePortal: boolean = false;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
Reference in New Issue
Block a user