Everything in Angular 2 is a component these are the basic building blocks of an Angular application. A component in Angular allows us to create a
reusable UI widget. A component can be used by any other component as a nested component.
A component in Angular is composed of 3 things ie. class (Code required for the UI) + template (UI) + decorator (add metadata to the class)
A component in Angular is a class with a template and a decorator. Components are the basic building blocks of an Angular application.
Decorator - A class becomes an Angular component when it is decorated with the Component decorator
A component in Angular is composed of 3 things ie. class (Code required for the UI) + template (UI) + decorator (add metadata to the class)
Template - Defines the user interface. Contains the HTML, directives, and bindings.
Class - A class in angular contain methods and properties. Properties contain the data that we want to display in the view template and methods contain the logic for the view. TypeScript is used to create the classes.
No comments:
Post a Comment