Using Angular CLI we can quickly generate component structure. Before that make sure you have
- npm
- angular CLI
preinstalled on your system. For better understanding of angular project structure I suggest the following post
- Project Structure : Angularjs - Angular Project Structure
Install CLI
If you already have the angular CLI installed , skip this step
npm install @angular/cli
Model
Model is a class used to store data for specific purposes. For example a Model class can be used to capture data in a template driven forms.
Generate class
Use the following command to generate class from the project root
ng g class model-class-name // say User
Don’t forget to visit the source code page