This repository was archived by the owner on Dec 6, 2017. It is now read-only.
This repository was archived by the owner on Dec 6, 2017. It is now read-only.
Ability to inject parameterized type with non primitive #170
Open
Description
Is it possible for the following to be made possible as currently i recieve the following error:
No provider found for GenericClass! (resolving IndexComponent -> IndexComponent -> GenericClass)
But it works if I use string instead of TestClass
My code:
@Injectable()
class GenericClass<T>{
GenericClass();
}
class TestClass{
}
class Bootstrap extends Module {
Bootstrap() {
bind(new TypeLiteral<GenericClass<TestClass>>().type, inject: [], toFactory: ()=> new GenericClass<TestClass>());
bind(IndexComponent);
}
}
@Injectable()
class IndexComponent {
GenericClass<TestClass> _test;
IndexComponent(this._test);
}
Metadata
Metadata
Assignees
Labels
No labels