What are modules in Angular?

A module is our application’s logical boundary. It’s a container for code that deals with a certain element of the programme, such as routing, HTTP, validation, and so on. Modules are mostly used to improve the composability of applications. For example, if we want to build validation logic using other libraries, we may create a new validation module and replace the current one with the new one, and our application will continue to function normally. The NgModule decorator is used to construct a module in Angular.