/angular/

Angular, Template Variable, One-Way Binding, Two-Way Binding

2017-11-12 04:32:56

(Template Variable)


## (Template Variable)

<input #email="" type='"text"/'/>





<button (click)='"logMessage(email.value)"' btn-success&quot;="" class='"btn'>Save</button>

(One-Way Binding)


## (One-Way Binding)

<input [value]='"email"' type='"text"/'/>





<button (click)='"logMessage()"' btn-success&quot;="" class='"btn'>Save</button>

(Two-Way Binding)


## (Two-Way Binding)

<input [(ngmodel)]='"email"' type='"text"/'/>





<button (click)='"logMessage()"' btn-success&quot;="" class='"btn'>Save</button>