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:
Brandy Carney
2023-11-09 14:24:58 -05:00
committed by GitHub
parent aeeb84b77d
commit 33200a9311
5 changed files with 20 additions and 9 deletions

View File

@ -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';

View 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);
}
}