Creating our first component
Components are the basic building blocks of an Angular application. They control different parts of a web page called views, such as a list of products or a registration form. An Angular application consists of a tree of components that can interact with each other:
The architecture of an Angular application is based on components. Each Angular component can communicate and interact with one or more components in the component tree. As we can see in the previous diagram, a component can simultaneously be a parent of some child components and a child of another parent component.
One of the most commonly used commands of the Angular CLI is the generate
command, which we use to create certain Angular artifacts. We define the <type>
of the artifact and its <name>
in the following syntax:
ng generate <type> <name>
You can find a list of available types at...