what is module?
In Angular, a module is a mechanism to group components, directives, pipes and services that are related, in such a way that can be combined with other modules to create an application. An Angular application can be thought of as a puzzle where each piece (or each module) is needed to be able to see the full picture.
How to create a module:
Syntax: ng generate module user-auth
And create a component inside the module(user-auth).
Syntax: ng generate component user-auth/login
After create a component inside the module:
How to use login component in app.module.ts.
Step 1: Here login is component and here exports this component in the user-auth.module.ts
Step 2: in the app.module.ts. we can imports the module(userAuthModule) in Imports:[ UserAuthModule], section
Step 3: In the app.component.html. we can add the component(<app-login></app-login>) here
Step 4:
Step 5: output
0 Comments