In last section of tutorial we learnt setting up angular 8 environment to create first angular project. In this tutorial we will learn about component in angular and see steps to generate a component.
In this tutorial we will see overview of folder structure of angular 8 application. Later we will see the different ways to create a component.
Angular project has following structure. It has e2e folder which is used for writing test, node_module contains pre-defined plugins, src folder which has all the code related to project.
Now let's add component. You can add new component by right clicking manually on src folder and adding folder, component, style, test one by one.
You can also open terminal or command prompt to generate component automatically.
You can use below command to generate a component. It will generate component.ts, component.html, component.css and component.spec.ts files.
You can also use below short command to generate component where "g" stands for generate and "c" stands for component.
If you want to ignore spec and style files during component generation, you can use "--skipTest" to skip spec file and "-is" to skip style file. to skip test now please use "--skip-tests" instead of "--skipTests"