We define components as simple classes which are declared as components with the help of component decorators. It becomes easy to create an application that already works, with the help of angular CLI commands.
The “Ng generate” is used to generate components, routes, services, and pipes. Also the simple test shells are also created with the help of this CLI command. In order to generate a component in angular4 with the help of CLI command, following the below syntax-
ng generate component component_name;
It generates the component and adds the component to module declarations.