teys-injector
v1.0.5
Published
very simple injector for Typescript code to simplify and speed up code production
Downloads
1
Maintainers
Readme
teys-injector
Simple injector syntax for Typescript code. It allows you to set dependency
import { Injectable, Inject } from "teys-injector";
@Injectable()
class Service {
method1(): boolean {
return false;
}
}
import { Inject } from "teys-injector";
class OtherClass {
@Inject()
svc: Service;
method2() {
return this.svc.method1();
}
}
You can also register manually values and resolve them
import { Injector } from "teys-injector";
Injector.Register("user", { username: 'default' });
import { Injector } from "teys-injector";
const defaultUser = Injector.Resolve<User>("user");
Not supported yet
- Injectable constructor parameters