Reputation: 37
<td>{{count}}</td>
<td><div class="col-xs-12"><input type="text" ng-keypress="count ='10'" ng-init="count=0"></div></td>
Its working but I want to put the input text value into the count= to display the input value in the {{count}} So if I write 20 into the input box the {{count}} must be 20 etc. But I dont know how to put the input text value into the ng-keypress without adding extra javascript parts.
Upvotes: 1
Views: 460
Reputation: 136144
Put ng-model
directive on input
element, That will enable two way binding and remove ng-keypress
which isn't make sense there to have it.
<td>
<div class="col-xs-12">
<input type="text" ng-model="count" ng-init="count=0">
</div>
</td>
Upvotes: 1