Home > Web Front-end > JS Tutorial > body text

About AngularJs ng-change event/directive usage

小云云
Release: 2018-05-10 17:23:21
Original
2547 people have browsed it

This article mainly introduces the summary of AngularJs ng-change events/commands. The editor thinks it is quite good, so I will share it with you now and give it as a reference. Let’s follow the editor to take a look, I hope it can help everyone.

Definition and Usage

The ng-change directive is used to tell AngularJS what to do when the value of an HTML element changes.

The ng-change directive needs to be used with the ng-model directive.

AngularJS ng-change directive will not override the native onchange event. If this event is triggered, both the ng-change expression and the native onchange event will be executed.

ng-change event is triggered every time the value changes, it does not need to wait for a completed modification process, or wait for the action to lose focus.

ng-change event is only for actual modification of the input box value, not modification through JavaScript.

Syntax

<element ng-change="expression"></element>
Copy after login
  1. ,