You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version 1.6 of FoalTS will give the possibility to inject manually class instances (#599). This can be useful for example to inject TypeORM connections.
However, this is not sufficient to inject TypeORM repositories as they are generic classes.
// This cannot work. After compilation only the class `Repository` remains.classController{
@dependencyusers: Repository<User>;
@dependencyproducts: Repository<Product>;}
Solution
Add a new @Dependency decorator to allow to inject services with string keys and values.
LoicPoullain
changed the title
Allow to inject TypeORM repositories (and other generic classes)
Allow to inject TypeORM repositories (and other generic classes and interfaces)
Apr 16, 2020
Issue
Version 1.6 of FoalTS will give the possibility to inject manually class instances (#599). This can be useful for example to inject TypeORM connections.
However, this is not sufficient to inject TypeORM repositories as they are generic classes.
Solution
Add a new
@Dependency
decorator to allow to inject services with string keys and values.TODO: update also
createService
Related issues
#538 #598
The text was updated successfully, but these errors were encountered: