@@ -13,7 +13,7 @@ import {Injector} from '../di/injector';
1313import { InjectorMarkers } from '../di/injector_marker' ;
1414import { getInjectorDef } from '../di/interface/defs' ;
1515import { InjectFlags } from '../di/interface/injector' ;
16- import { Type } from '../interface/type' ;
16+ import { AbstractType , Type } from '../interface/type' ;
1717import { assertDefined , assertEqual , assertIndexInRange } from '../util/assert' ;
1818import { noSideEffects } from '../util/closure' ;
1919
@@ -347,7 +347,8 @@ export function injectAttributeImpl(tNode: TNode, attrNameToInject: string): str
347347
348348
349349function notFoundValueOrThrow < T > (
350- notFoundValue : T | null , token : Type < T > | InjectionToken < T > , flags : InjectFlags ) : T | null {
350+ notFoundValue : T | null , token : Type < T > | AbstractType < T > | InjectionToken < T > , flags : InjectFlags ) : T |
351+ null {
351352 if ( flags & InjectFlags . Optional ) {
352353 return notFoundValue ;
353354 } else {
@@ -365,8 +366,8 @@ function notFoundValueOrThrow<T>(
365366 * @returns the value from the injector or throws an exception
366367 */
367368function lookupTokenUsingModuleInjector < T > (
368- lView : LView , token : Type < T > | InjectionToken < T > , flags : InjectFlags , notFoundValue ?: any ) : T |
369- null {
369+ lView : LView , token : Type < T > | AbstractType < T > | InjectionToken < T > , flags : InjectFlags ,
370+ notFoundValue ?: any ) : T | null {
370371 if ( flags & InjectFlags . Optional && notFoundValue === undefined ) {
371372 // This must be set or the NullInjector will throw for optional deps
372373 notFoundValue = null ;
@@ -408,7 +409,7 @@ function lookupTokenUsingModuleInjector<T>(
408409 * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided
409410 */
410411export function getOrCreateInjectable < T > (
411- tNode : TDirectiveHostNode | null , lView : LView , token : Type < T > | InjectionToken < T > ,
412+ tNode : TDirectiveHostNode | null , lView : LView , token : Type < T > | AbstractType < T > | InjectionToken < T > ,
412413 flags : InjectFlags = InjectFlags . Default , notFoundValue ?: any ) : T | null {
413414 if ( tNode !== null ) {
414415 const bloomHash = bloomHashBitOrFactory ( token ) ;
@@ -508,7 +509,7 @@ export function createNodeInjector(): Injector {
508509}
509510
510511function searchTokensOnInjector < T > (
511- injectorIndex : number , lView : LView , token : Type < T > | InjectionToken < T > ,
512+ injectorIndex : number , lView : LView , token : Type < T > | AbstractType < T > | InjectionToken < T > ,
512513 previousTView : TView | null , flags : InjectFlags , hostTElementNode : TNode | null ) {
513514 const currentTView = lView [ TVIEW ] ;
514515 const tNode = currentTView . data [ injectorIndex + NodeInjectorOffset . TNODE ] as TNode ;
@@ -555,7 +556,7 @@ function searchTokensOnInjector<T>(
555556 * @returns Index of a found directive or provider, or null when none found.
556557 */
557558export function locateDirectiveOrProvider < T > (
558- tNode : TNode , tView : TView , token : Type < T > | InjectionToken < T > | string ,
559+ tNode : TNode , tView : TView , token : Type < T > | AbstractType < T > | InjectionToken < T > | string ,
559560 canAccessViewProviders : boolean , isHostSpecialCase : boolean | number ) : number | null {
560561 const nodeProviderIndexes = tNode . providerIndexes ;
561562 const tInjectables = tView . data ;
@@ -646,8 +647,8 @@ export function getNodeInjectable(
646647 * @returns the matching bit to check in the bloom filter or `null` if the token is not known.
647648 * When the returned value is negative then it represents special values such as `Injector`.
648649 */
649- export function bloomHashBitOrFactory ( token : Type < any > | InjectionToken < any > | string ) : number | Function |
650- undefined {
650+ export function bloomHashBitOrFactory ( token : Type < any > | AbstractType < any > | InjectionToken < any > |
651+ string ) : number | Function | undefined {
651652 ngDevMode && assertDefined ( token , 'token must be defined' ) ;
652653 if ( typeof token === 'string' ) {
653654 return token . charCodeAt ( 0 ) || 0 ;
0 commit comments