Closed davidmpaz closed 6 years ago
Thank you for your PR but I don't see a benefit in having this. You can call getConnection()
or getRepository()
in any file of your project without depending on any DI.
Agreed.
I made it because that's what I wanted to avoid. Just taste thing I would say.
I guess this can be closed?
yeap
Hi,
thanks for this example project, has help me a lot already. I am making this PR since I stumble with issue typeorm/typeorm#1335 while trying to provide my connection through angular DI mechanism.
The old approach of using a provider mentioned in this thread helped, but still we not exactly the same as providing the connection itself. I did came up with this solution.
My request is to add this PR into another branch and make references in docs, so we have another example under the belt.
best regards.
Commit msg Delegate the creation of the connection to the factory function. Allow to inject the connection into components through @Inject().
Changes: