Mudanças entre as edições de "Data binding"

De Basef
Ir para: navegação, pesquisa
Linha 1: Linha 1:
* Variable binding
+
* Variable binding:
 
<source lang="javascript">
 
<source lang="javascript">
 
{{ value }}
 
{{ value }}
Linha 5: Linha 5:
  
  
* Property binding
+
* Property binding:
 
<source lang="javascript">
 
<source lang="javascript">
 
[property]="value"
 
[property]="value"
Linha 11: Linha 11:
  
  
* Event binding
+
* Event binding:
 
<source lang="javascript">
 
<source lang="javascript">
 
[event]="handler"
 
[event]="handler"
Linha 17: Linha 17:
  
  
* Bi-directional property binding (any change in DOM is reflected in the component and vice versa)
+
* Bi-directional property binding (any change in DOM is reflected in the component and vice versa):
 
<source lang="javascript">
 
<source lang="javascript">
 
[(ngModel)]="property"
 
[(ngModel)]="property"

Edição das 15h12min de 27 de abril de 2018

  • Variable binding:
{{ value }}


  • Property binding:
[property]="value"


  • Event binding:
[event]="handler"


  • Bi-directional property binding (any change in DOM is reflected in the component and vice versa):
[(ngModel)]="property"