11// make sure you import mocha-config before @angular/core
2- import { Component , NgModule , NO_ERRORS_SCHEMA , ViewContainerRef } from '@angular/core' ;
2+ import { Component , inject , NgModule , NO_ERRORS_SCHEMA , ViewContainerRef } from '@angular/core' ;
33import { TestBed , waitForAsync } from '@angular/core/testing' ;
44import { FrameService , ModalDialogParams , ModalDialogService , NSLocationStrategy , Outlet } from '@nativescript/angular' ;
55import { Frame , isIOS } from '@nativescript/core' ;
@@ -13,7 +13,7 @@ const CLOSE_WAIT = isIOS ? 1000 : 0;
1313 schemas : [ NO_ERRORS_SCHEMA ] ,
1414} )
1515export class ModalComponent {
16- constructor ( public params : ModalDialogParams ) { }
16+ params = inject ( ModalDialogParams ) ;
1717
1818 onShownModally ( ) {
1919 const result = this . params . context ;
@@ -28,7 +28,7 @@ export class ModalComponent {
2828 schemas : [ NO_ERRORS_SCHEMA ] ,
2929} )
3030export class FailComponent {
31- constructor ( public service : ModalDialogService ) { }
31+ service = inject ( ModalDialogService ) ;
3232}
3333
3434@Component ( {
@@ -40,12 +40,10 @@ export class FailComponent {
4040 schemas : [ NO_ERRORS_SCHEMA ] ,
4141} )
4242export class SuccessComponent {
43- constructor (
44- public service : ModalDialogService ,
45- public vcRef : ViewContainerRef ,
46- public locationStrategy : NSLocationStrategy ,
47- public fakeFrameService : FrameService ,
48- ) { }
43+ service = inject ( ModalDialogService ) ;
44+ vcRef = inject ( ViewContainerRef ) ;
45+ locationStrategy = inject ( NSLocationStrategy ) ;
46+ fakeFrameService = inject ( FrameService ) ;
4947}
5048
5149@NgModule ( {
0 commit comments