Mudanças entre as edições de "Data binding"
De Basef
| Linha 8: | Linha 8: | ||
<source lang="javascript"> | <source lang="javascript"> | ||
[property]="value" | [property]="value" | ||
| + | </source> | ||
| + | |||
| + | or | ||
| + | |||
| + | <source lang="javascript"> | ||
| + | bind-property="value" | ||
</source> | </source> | ||
| Linha 13: | Linha 19: | ||
* Event binding: | * Event binding: | ||
<source lang="javascript"> | <source lang="javascript"> | ||
| − | + | (event)="handler" | |
| + | </source> | ||
| + | |||
| + | or | ||
| + | |||
| + | <source lang="javascript"> | ||
| + | on-event="handler" | ||
</source> | </source> | ||
| Linha 20: | Linha 32: | ||
<source lang="javascript"> | <source lang="javascript"> | ||
[(ngModel)]="property" | [(ngModel)]="property" | ||
| + | </source> | ||
| + | |||
| + | or | ||
| + | |||
| + | <source lang="javascript"> | ||
| + | bindon-ngModel="property" | ||
</source> | </source> | ||
[[Category: AngularJS2]] | [[Category: AngularJS2]] | ||
Edição das 16h15min de 27 de abril de 2018
- Variable binding:
{{ value }}
- Property binding:
[property]="value"
or
bind-property="value"
- Event binding:
(event)="handler"
or
on-event="handler"
- Bi-directional property binding (any change in DOM is reflected in the component and vice versa):
[(ngModel)]="property"
or
bindon-ngModel="property"