While the statement does nothing useful, it satisfies Angular's requirement so that Angular will update the screen. Focus events are kind of a pain.
When a user interacts with your app, it's sometimes necessary to know when this happens. In Angular 5, two new form validation techniques are introduced. The value of Document.activeElement varies across browsers while this event is being handled (bug 452307): IE10 sets it to the element that the focus will move to, while Firefox and Chrome often set it to the body of the document.. See also. Handle Blur and Focus Events. Output of AngularJS ng-focus Event Example Following is the result of using ng-focus event in angularjs applications. Focus events are kind of a pain.
The ng-blur directive tells AngularJS what to do when an HTML element loses focus. ```ts // example without validators const c = new FormControl(, { updateOn: blur }); // example with validators const c= new FormControl(, { validators: Validators.required, updateOn: blur }); ``` Like in AngularJS, setting `updateOn` to `blur` will delay the update of the value as well as the validation status. Angular offers plenty of event types to communicate with your app. Now it's available out of the box and you don't need any custom implementations. This example code binds the keyup event to the number 0, the shortest template statement possible. This angularjs ng-blur event directive is supported by ,