So I created Slickgrid-Universal as a monorepo and it is also a framework agnostic library. One the biggest reason I’ve created that lib was to extract all the common code that I have in Angular-Slickgrid and Aurelia-Slickgrid, they share a big portion of common code, something like 80%… So anyway, I’m now ready to go to the next step which is to start rewriting, mainly deleting a lot of code in Aurelia-Slickgrid and start using the common code from Slickgrid-Universal (which again is a framework agnostic lib)… but now I’m blocked at the Dependency Injection part, if I use
@inject(MyService) inside Aurelia-Slickgrid, it does go into its constructor but I have plenty of services calling other services and they all come back as undefined and they don’t call their sub-services. I thought that perhaps I’m missing a small DI system in Slickgrid-Universal and I tried to implement TypeDI which is small and might be the cousin of TypeORM but that doesn’t do anything. It seems that Aurelia doesn’t know what to do with these services apart from just calling
new MyService() without any of it’s other sub-services inside the MyService constructor.
So the question is… does Aurelia v1 support DI of other lib which multiple services calling themselves multiple services? For example this GridState Service calls multiple other services via in its constructor, is it possible to make Aurelia aware of what is has to do when calling each constructor?
If that doesn’t work, the worst case is not that bad, I can still get it to work by instantiating all services manually like I’ve done in my vanilla implementation on this line but I would rather use Aurelia DI and let it handle DI as much as possible (if it is actually possible)… anyway that is still a plan B