diff --git a/projects/hyperdash-angular/src/model/decorators/model-inject.service.ts b/projects/hyperdash-angular/src/model/decorators/model-inject.service.ts index d85afcb0..0a78e553 100644 --- a/projects/hyperdash-angular/src/model/decorators/model-inject.service.ts +++ b/projects/hyperdash-angular/src/model/decorators/model-inject.service.ts @@ -1,4 +1,4 @@ -import { Injectable, InjectionToken, Injector, Type } from '@angular/core'; +import { AbstractType, Injectable, InjectionToken, Injector, Type } from '@angular/core'; import { ModelApi, ModelDecorator } from '@hypertrace/hyperdash'; @Injectable({ providedIn: 'root' }) @@ -85,7 +85,7 @@ type PropertyKey = string | number; interface ModelInjectData { injectHostClass: Type; propertyKey: PropertyKey; - injectKey: InjectionToken | Type; + injectKey: InjectionToken | Type | AbstractType; } const injectDefinitions: ModelInjectData[] = []; @@ -95,7 +95,9 @@ const injectDefinitions: ModelInjectData[] = []; * @see `MODEL_API` */ // tslint:disable-next-line:only-arrow-functions -export function ModelInject(injectKey: InjectionToken | Type): PropertyDecorator { +export function ModelInject( + injectKey: InjectionToken | Type | AbstractType +): PropertyDecorator { return (modelPrototype: object, propertyKey: string | symbol): void => { injectDefinitions.push({ injectHostClass: modelPrototype.constructor as Type,