Angular 2.0 Components - Part 2
Templates
define a component's view or HTML content for the component.In template there are two type define templateThis is how it work
Metadata
Metadata defines the way to process a class. We can define the metadata by using decorator.Data binding
Used to bind the data between view and business logic.In angular 2.0 there are four forms of data binding. As a summary of data binding.
Directives
Used to extend HTML attributes and provide some special behaviors to HTML DOM elements.A directive is a class with a @Directive decorator.- structural directives : alter layout by adding, removing, and replacing elements in DOM
- Attribute directives : alter the appearance or behavior of an existing element.
Services
A service is typically a class with a narrow, well-defined purpose.Those services available to components through dependency injection.Services are injected into application using dependency injection mechanism.Dependency Injections
Mechanism to pass an object as a dependency in a different component. Most dependencies are services.constructor(private service: UserService) { }
Comments
Post a Comment