-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathmodal-controller.ts
More file actions
25 lines (22 loc) · 1010 Bytes
/
modal-controller.ts
File metadata and controls
25 lines (22 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { Injector, Injectable, EnvironmentInjector, inject } from '@angular/core';
import { AngularDelegate, OverlayBaseController } from '@ionic/angular/common';
import type { AngularModalOptions } from '@ionic/angular/common';
import { modalController } from '@ionic/core/components';
import { defineCustomElement } from '@ionic/core/components/ion-modal.js';
@Injectable()
export class ModalController extends OverlayBaseController<AngularModalOptions, HTMLIonModalElement> {
private angularDelegate = inject(AngularDelegate);
private injector = inject(Injector);
private environmentInjector = inject(EnvironmentInjector);
constructor() {
super(modalController);
defineCustomElement();
}
create(opts: AngularModalOptions): Promise<HTMLIonModalElement> {
const { injector: customInjector, ...restOpts } = opts;
return super.create({
...restOpts,
delegate: this.angularDelegate.create(this.environmentInjector, this.injector, 'modal', customInjector),
});
}
}