DEV Community

Discussion on: Simple example custom repository with NestJS 7.x/8.x and TypeORM 😻

Collapse
 
micalevisk profile image
Micael Levi L. C. • Edited

nvm. I just tried this and confirm that we can't inject things on custom repository because they aren't controlled by Nest container.

More on this here: stackoverflow.com/a/65227341/5290447

Collapse
 
tony133 profile image
Antonio Tripodi • Edited

my writing error, thanks for the correct report, it works even without the @injectable decorator, I corrected the post, in fact at the beginning of the post I had written it correctly.

Thread Thread
 
fabianaasara profile image
Fabiana Asara

Yes, it does work without @Injectable it's happened to me when I did a tech test and it was pointed out to me at the interview. But I still don't know why, it shouldn't work?

Thread Thread
 
fabianaasara profile image
Fabiana Asara

Btw, thanks for this post!! 🔥