Components in Angular2 - Part6

Опубликовано: 01 Январь 1970
на канале: Code With Rohini
49
5

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

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.


Смотрите видео Components in Angular2 - Part6 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Code With Rohini 01 Январь 1970, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 49 раз и оно понравилось 5 людям.