Uncaught Error: Cannot apply @injectable decorator multiple times.
at eval (injectable.js?719e:8)
at eval (inject.helper.js?5df8:10)
at DecorateConstructor (Reflect.js?98db:541)
at Object.decorate (Reflect.js?98db:130)
at _decorate (decorator_utils.js?66d7:42)
at Object.decorate (decorator_utils.js?66d7:55)
at Container.addSingleton (container.js?7644:42)
at containerBuilder (app.container.ts?1e2a:26)
at new AppModule (main.ts?bc82:13)
at eval (main.ts?bc82:30)
This is my code
import { container, injectable } from 'inversify-props';
interface Test {
id: string;
}
interface TestChild extends Test {
name: string;
}
interface ServiceInterface<T extends Test> {
get(): Promise<T>;
}
@injectable()
class Services implements ServiceInterface<TestChild> {
get(): Promise<TestChild> {
throw new Error('Method not implemented.');
}
}
export function containerBuilder(): void {
container.addSingleton<ServiceInterface<TestChild>>(Services);
}
Hi
Error when I use generics throw an exception
Uncaught Error: Cannot apply @injectable decorator multiple times. at eval (injectable.js?719e:8) at eval (inject.helper.js?5df8:10) at DecorateConstructor (Reflect.js?98db:541) at Object.decorate (Reflect.js?98db:130) at _decorate (decorator_utils.js?66d7:42) at Object.decorate (decorator_utils.js?66d7:55) at Container.addSingleton (container.js?7644:42) at containerBuilder (app.container.ts?1e2a:26) at new AppModule (main.ts?bc82:13) at eval (main.ts?bc82:30)
This is my code
How can I do to make it work?