Modern Full-Stack Development with Nest.js, React, TypeScript, and MongoDB: Part 1

Hello @eddzmaciel. Thanks for reading!

  1. PostModel became part of the BlogModule immediately after it was registered within the BlogModule.
  2. Once you import a particular module into another. It will inherit all its dependencies and have access to all its functionalities as well. In this case, you can define PostModel in a different Module and import that Module into BlogModule.

But I will advise that you define and set up the configuration of PostModel within the root Module (i.e AppModule()) if you prefer to give it global scope.

I hope that answers your question? Thanks for the ping @konrad.sopala

1 Like