Angular — Part 2
Building Blocks of Angular :
Each Angular application can be thought of as a collection of components. And Each component is a folder consisting of html file, typescript file and style files. Let’s understand them in detail :
- Components : Components are the building blocks that compose an application. . In the typescript file, we have a decorator that specifies the following Angular-specific information:
- A CSS selector that defines how the component is used in a template. HTML elements in your template that match this selector become instances of the component.
- An HTML template that instructs Angular how to render the component.
- An optional set of CSS styles that define the appearance of the template’s HTML elements.
To learn more about components, visit https://angular.io/guide/component-overview
Components also make your application easier to unit test and can improve the overall readability of your code.
2. Templates : Every component has an HTML template that declares how that component renders. We can define this template either inline or by file path.
To learn more about templates, visit : https://angular.io/guide/template-syntax