Skip to main content

Posts

Showing posts with the label NgModules decorator

What Is Feature Modules? What Are the Types of Feature Modules?

What Is Feature Modules? What Are the Types of Feature Modules? The feature modules are modules that goal of organizing an application code.  It also helps you partition the app into focused areas when you can do everything within the root module. There are five types of feature modules which are the following- 1.            Domain Feature Modules 2.            Routed Feature Modules 3.            Routing Modules 4.            Service Feature Modules 5.            Widget Feature Modules Routed Feature Module  - Routed feature modules are domain feature modules that components targets of router navigation routes. A lazy-loaded routed feature module should not be imported by any module. Routed feature ...

What Are the Purpose of @NgModule?

What Are the Purpose of @NgModule? The NgModule is used to simplify the ways you define and manage the dependencies in your applications and also you can consolidate different components and services into cohesive blocks of functionality. The @NgModule metadata divided into three categories as follows. 1.            Static 2.            Runtime 3.            Composability/Grouping Static  – It is compiler configuration and configured via the declarations array. Runtime  - It is injector configuration and configured via the provider’s array. Composability/Grouping  – Introducing NgModules  together and configured via the imports and exports arrays. The following is an example of specifying a NgModule metadata - @ NgModule ({    // Static, This is the compiler configuration ...

Why use multiple NgModules?

Multiple NgModules  provides some potential benefits. Actually, the modules help you to organize an application into associative blocks of functionality. First one is organizing an application code. If you are  putting around 99 resource files in the default app module and see the happing. And the second one is - It opens the possibility of lazy loading via the router.

What Is Modules (@NgModule decorator)?

The NgModule is a TypeScript class marked by the @NgModule decorator. The NgModule is a class and work with the @NgModule decorator function and also takes a metadata object that tells Angular how to compile and run module code. The Angular module helps you to organize an application into associative blocks of functionality. An angular module represents a core concept and plays a fundamental role in structuring Angular applications. The NgModule is used to simplify the ways you define and manage the dependencies in your applications and also you can consolidate different components and services into associative blocks of functionality. Every Angular application should have at least one module and it contains the components, service providers, pipes and other code files whose scope is defined by the containing NgModule. The purpose of the module is to declare everything you create in Angular and group them together. Every application has at least one Angular mo...