March 2017
Intermediate to advanced
821 pages
18h 21m
English
An Angular 2 application is completely split into components. Technically, an Angular 2 component is a reusable custom tag that is mutable and encapsulated with an embedded state, that is, changes to the state or properties will mutate the UI.
Remember that Angular 2 doesn't register the custom tag name as a custom element.
All the components of the application are arranged in a tree structure, with a component as the root node.
Here is an example of how to create a component. It creates a card component that displays an image, title, and description. Place this code in the <script> tag:
var Card = ng.core.Component({ selector: "card", inputs: ["src", "title", "desc"], templateUrl: "templates/card-template.html", styleUrls: ...Read now
Unlock full access