Skip to content

Commit 36dda98

Browse files
committed
feat: make NativeDialogService consistent with cdk (rename to NativeDialog)
1 parent 77eb33d commit 36dda98

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

packages/angular/src/lib/cdk/dialog/dialog-content-directives.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import { Directive, Input, OnChanges, OnInit, Optional, SimpleChanges, ElementRef, HostListener } from '@angular/core';
9+
import { Directive, ElementRef, HostListener, Input, OnChanges, OnInit, Optional, SimpleChanges } from '@angular/core';
1010
import { View, ViewBase } from '@nativescript/core';
11-
import { NativeDialogService } from './dialog-services';
1211
import { NativeDialogRef } from './dialog-ref';
12+
import { NativeDialog } from './dialog-services';
1313

1414
/**
1515
* Button that will close the current dialog.
@@ -31,7 +31,7 @@ export class NativeDialogCloseDirective implements OnInit, OnChanges {
3131
// tslint:disable-next-line: lightweight-tokens
3232
@Optional() public dialogRef: NativeDialogRef<any>,
3333
private _elementRef: ElementRef<View>,
34-
private _dialog: NativeDialogService
34+
private _dialog: NativeDialog,
3535
) {}
3636

3737
ngOnInit() {
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { NgModule } from '@angular/core';
22
import { NativeDialogCloseDirective } from './dialog-content-directives';
3-
import { NativeDialogService } from './dialog-services';
3+
import { NativeDialog } from './dialog-services';
44

55
@NgModule({
66
imports: [NativeDialogCloseDirective],
77
exports: [NativeDialogCloseDirective],
8-
providers: [NativeDialogService],
8+
providers: [NativeDialog],
99
})
1010
export class NativeDialogModule {}

packages/angular/src/lib/cdk/dialog/dialog-services.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const NATIVE_DIALOG_DEFAULT_OPTIONS = new InjectionToken<NativeDialogConf
3838
@Injectable({
3939
providedIn: 'root',
4040
})
41-
export class NativeDialogService implements OnDestroy {
41+
export class NativeDialog implements OnDestroy {
4242
private _openDialogsAtThisLevel: NativeDialogRef<any>[] = [];
4343
private readonly _afterAllClosedAtThisLevel = new Subject<void>();
4444
private readonly _afterOpenedAtThisLevel = new Subject<NativeDialogRef<any>>();
@@ -248,3 +248,10 @@ export class NativeDialogService implements OnDestroy {
248248
function _applyConfigDefaults(config?: NativeDialogConfig, defaultOptions?: NativeDialogConfig): NativeDialogConfig {
249249
return { ...defaultOptions, ...config };
250250
}
251+
252+
export {
253+
/**
254+
* @deprecated Use `NativeDialog` instead.
255+
*/
256+
NativeDialog as NativeDialogService,
257+
};

0 commit comments

Comments
 (0)