angular module and components | create angular module | create angular components |okay java
Buy me a coffee - https://www.buymeacoffee.com/okayjava
what is angular module ?
Angular refers to a place where you can group the components, directives, pipes, and services.
command to create a new module
ng g m yourmodulename
ng generate module yourmodulename
Each module will have its own yourmodulename.module.ts file
what is angular component?
Components are the main building block for Angular applications
Each component will have 4 files 1. HTML, 2. TS, 3. CSS 4. Test case file
Command to create component
cd yourmodulename
ng g c yourcomponentname
ng generate component yourcomponentname
#Steps to use new module and component
1. Goto yourmodulename.module.ts file
Export yourcomponentname ( new component )
exports : [ yourcomponentname ]
2. Goto app.module.ts (root module)
Add yourmodulename ( new module ) in imports section
imports :[ yourmodulename ]
3. Copy the value of selector from yourcomponentname .module.ts file
and add in app.component.html file
yourcomponent-selector-value
Enjoy :)
On this page of the site you can watch the video online angular module and components | create angular module | create angular components | okay java with a duration of hours minute second in good quality, which was uploaded by the user okay java 29 October 2021, share the link with friends and acquaintances, this video has already been watched 959 times on youtube and it was liked by 16 viewers. Enjoy your viewing!