Skip to content

Commit a8aaf26

Browse files
authored
feat: adding abstract type (#102)
1 parent 2f51d49 commit a8aaf26

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

projects/hyperdash-angular/src/model/decorators/model-inject.service.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Injectable, InjectionToken, Injector, Type } from '@angular/core';
1+
import { AbstractType, Injectable, InjectionToken, Injector, Type } from '@angular/core';
22
import { ModelApi, ModelDecorator } from '@hypertrace/hyperdash';
33

44
@Injectable({ providedIn: 'root' })
@@ -85,7 +85,7 @@ type PropertyKey = string | number;
8585
interface ModelInjectData {
8686
injectHostClass: Type<unknown>;
8787
propertyKey: PropertyKey;
88-
injectKey: InjectionToken<unknown> | Type<unknown>;
88+
injectKey: InjectionToken<unknown> | Type<unknown> | AbstractType<unknown>;
8989
}
9090

9191
const injectDefinitions: ModelInjectData[] = [];
@@ -95,7 +95,9 @@ const injectDefinitions: ModelInjectData[] = [];
9595
* @see `MODEL_API`
9696
*/
9797
// tslint:disable-next-line:only-arrow-functions
98-
export function ModelInject(injectKey: InjectionToken<unknown> | Type<unknown>): PropertyDecorator {
98+
export function ModelInject(
99+
injectKey: InjectionToken<unknown> | Type<unknown> | AbstractType<unknown>
100+
): PropertyDecorator {
99101
return (modelPrototype: object, propertyKey: string | symbol): void => {
100102
injectDefinitions.push({
101103
injectHostClass: modelPrototype.constructor as Type<unknown>,

0 commit comments

Comments
 (0)