View source Improve this doc

ngChange
directive in module ng

Description

Evaluate the given expression when the user changes the input. The expression is evaluated immediately, unlike the JavaScript onchange event which only triggers at the end of a change (usually, when the user leaves the form element or presses the return key). The expression is not evaluated when the value change is coming from the model.

Note, this directive requires ngModel to be present.

Usage

as attribute
<input ng-change="{expression}">
   ...
</input>

Parameters

ParamTypeDetails
ngChangeexpression

Expression to evaluate upon change in input value.

Example

Source







Demo