YouTip LogoYouTip

Ng Ng Focus

# AngularJS `ng-focus` Directive [![Image 3: AngularJS Reference](#) AngularJS Reference](#) * * * ## AngularJS Example Execute an expression when the input field gets focus:

{{count}}

[Try it Β»](#) * * * ## Definition and Usage **ng-focus** directive is used to tell AngularJS what operation to perform when an HTML element gets focus. **ng-focus** directive does not override the element's original onfocus event. When the event is triggered, both the **ng-focus** expression and the original onfocus event will be executed. * * * ## Syntax , , ,