Components in Angular2 - Part6

Veröffentlicht am: 01 Januar 1970
auf dem Kanal: Code With Rohini
50
5

To learn Angular2 from scratch and most useful for beginners Please see the link below:
   • What is AngularJS and What is Angular2  - ...  

To understand components in detail please see below link:
https://angular.io/api/core/Component

In this video tutorial, we will discuss - What is a component in Angular 2

In Part 1 of the Angular 2 tutorial, we discussed that everything in Angular 2 is a component i.e components are the basic building blocks of an Angular application.

What is a component in Angular 2
A component in Angular is a class with a template and a decorator. So in simple terms, a component in Angular is composed of these 3 things
1. Template - Defines the user interface. Contains the HTML, directives, and bindings.
2. Class - Contains the code required for template. Just like a class in any object-oriented programming language like C# or Java, a class in angular can 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. We use TypeScript to create the class.
3. Decorator - We use the Component decorator provided by Angular to add metadata to the class. A class becomes an Angular component when it is decorated with the Component decorator.

please fill free to asking any queries so please comment if u have any question.


Auf dieser Seite können Sie das Online-Video Components in Angular2 - Part6 mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Code With Rohini 01 Januar 1970 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 50 Mal angesehen und es wurde von 5 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!