3
3
ComponentRef ,
4
4
Directive ,
5
5
Injectable ,
6
+ Injector ,
6
7
NgModuleRef ,
7
- ReflectiveInjector ,
8
8
Type ,
9
9
ViewContainerRef
10
10
} from "@angular/core" ;
@@ -18,7 +18,7 @@ import { DetachedLoader } from "../common/detached-loader";
18
18
import { PageFactory , PAGE_FACTORY } from "../platform-providers" ;
19
19
import { once } from "../common/utils" ;
20
20
import { topmost , Frame } from "tns-core-modules/ui/frame" ;
21
- import { ShowModalOptions } from "tns-core-modules/ui/core/view" ;
21
+ import { ShowModalOptions } from "tns-core-modules/ui/core/view" ;
22
22
23
23
export type BaseShowModalOptions = Pick < ShowModalOptions , Exclude < keyof ShowModalOptions , "closeCallback" | "context" > > ;
24
24
@@ -126,11 +126,11 @@ export class ModalDialogService {
126
126
} ) ;
127
127
128
128
const modalParams = new ModalDialogParams ( options . context , closeCallback ) ;
129
- const providers = ReflectiveInjector . resolve ( [
130
- { provide : ModalDialogParams , useValue : modalParams } ,
131
- ] ) ;
132
129
133
- const childInjector = ReflectiveInjector . fromResolvedProviders ( providers , options . containerRef . parentInjector ) ;
130
+ const childInjector = Injector . create ( {
131
+ providers : [ { provide : ModalDialogParams , useValue : modalParams } ] ,
132
+ parent : options . containerRef . injector
133
+ } ) ;
134
134
const detachedFactory = options . resolver . resolveComponentFactory ( DetachedLoader ) ;
135
135
detachedLoaderRef = options . containerRef . createComponent ( detachedFactory , - 1 , childInjector , null ) ;
136
136
detachedLoaderRef . instance . loadComponent ( options . type ) . then ( ( compRef ) => {
0 commit comments