| Start |
|---|
| Angular 2 Templates A SIMPLE TEMPLATE Let’s start with a very simple template that shows our name and our favorite thing:
To render a value, we can use the standard double-curly syntax: Pipes, previously known as “Filters,” transform a value into a new value, like localizing a string or converting a floating point value into a currency representation:
To resolve and bind a variable to a component, use the [] syntax. If we have this.currentVolume in our component, we will pass this through to our component and the values will stay in sync:
To keep a binding up to date given user input and other events, use the [()] syntax. Think of it as a combination of handling an event and binding a property: <input [(ngModel)]="myName"> The this.myName value of your component will stay in sync with the input value.
Indicates that this directive treats this component as a template and will not draw it as-is. For example, ngFor takes our and stamps it out for each item in items, but it never renders our initial since it’s a template: Other similar directives that work on templates rather than rendered components are *ngIf and *ngSwitch. |
Read Article
https://develop.horje.com/learn/1434/reference