mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 09:34:19 +08:00
refactor(angular): use correct core instance for toast controller (#28493)
Issue number: N/A --------- ## What is the current behavior? As a takeaway from our learning session about a menuController bug in Ionic Angular, the team would like to update our other providers to use the same architecture as the menuController to prevent this kind of issue from happening again in the future. We also noticed that the common provider does not provide much value and it's easier to just have two separate implementations in `src` and `standalone`. (There wasn't much code we could de-duplicate) ## What is the new behavior? - Removed the common toast provider in favor of separate ones in src/standalone ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information
This commit is contained in:
@ -23,7 +23,6 @@ export {
|
||||
AlertController,
|
||||
LoadingController,
|
||||
PickerController,
|
||||
ToastController,
|
||||
AnimationController,
|
||||
GestureController,
|
||||
DomController,
|
||||
@ -38,10 +37,11 @@ export {
|
||||
ViewDidEnter,
|
||||
ViewDidLeave,
|
||||
} from '@ionic/angular/common';
|
||||
export { ModalController } from './providers/modal-controller';
|
||||
export { MenuController } from './providers/menu-controller';
|
||||
export { PopoverController } from './providers/popover-controller';
|
||||
export { ActionSheetController } from './providers/action-sheet-controller';
|
||||
export { MenuController } from './providers/menu-controller';
|
||||
export { ModalController } from './providers/modal-controller';
|
||||
export { PopoverController } from './providers/popover-controller';
|
||||
export { ToastController } from './providers/toast-controller';
|
||||
|
||||
// PACKAGE MODULE
|
||||
export { IonicModule } from './ionic-module';
|
||||
|
13
packages/angular/src/providers/toast-controller.ts
Normal file
13
packages/angular/src/providers/toast-controller.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OverlayBaseController } from '@ionic/angular/common';
|
||||
import type { ToastOptions } from '@ionic/core';
|
||||
import { toastController } from '@ionic/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ToastController extends OverlayBaseController<ToastOptions, HTMLIonToastElement> {
|
||||
constructor() {
|
||||
super(toastController);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user