I am using angular 2
, I want to change ngModel
after Enter press, in angular 1.X we can use ng-model-options="{updateOn: 'change blur'}"
, but in angular 2 how can we do?
angular 1.x
<input class="form-control value-max" type="text" ng-model="$ctrl.filterData.price_max" ng-model-options="{updateOn: 'change blur'}">
As of Angular 5 it is possible! You can write in your template:
<input [(ngModel)]="firstName" [ngModelOptions]="{updateOn: 'blur'}">
for more see: https://next.angular.io/api/forms/NgModel#options
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With