Header Ads

Angular Data Binding

Angular Data Binding
Oneway Binding
<p>{{name}}</p>
Property Binding
<input [value]="name"/>
Attribute Binding
<button [attr.aria-label]="OK">OK</button>/>
Twoway Binding
<input [(ngModel)]="name"/>
Event Binding - 1
<button (click)="onSave()">Save</button>/>
Event Binding - 2
<input [value]="name" (input)="name = $event.target.value" />

No comments:


Powered by Blogger.