File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,11 @@ export class Injector {
141
141
this . _syncStrategy = new _SyncInjectorStrategy ( this ) ;
142
142
}
143
143
144
+ /**
145
+ * Direct parent of this injector.
146
+ */
147
+ get parent ( ) : Injector { return this . _parent ; }
148
+
144
149
/**
145
150
* Retrieves an instance from the injector.
146
151
*
Original file line number Diff line number Diff line change @@ -348,6 +348,12 @@ export function main() {
348
348
349
349
expect ( childCar ) . toBe ( parentCar ) ;
350
350
} ) ;
351
+
352
+ it ( "should give access to direct parent" , ( ) => {
353
+ var parent = Injector . resolveAndCreate ( [ ] ) ;
354
+ var child = parent . resolveAndCreateChild ( [ ] ) ;
355
+ expect ( child . parent ) . toBe ( parent ) ;
356
+ } ) ;
351
357
} ) ;
352
358
353
359
describe ( "lazy" , function ( ) {
You can’t perform that action at this time.
0 commit comments