ngModel
ng
Is a directive that tells Angular to do two-way data binding. It works together with input
,
select
, textarea
and even custom form controls that use NgModelController
exposed by this directive.
ngModel
is responsible for:
input
, textarea
or select
require,ng-valid
, ng-invalid
, ng-dirty
, ng-pristine
),form
.Note: ngModel
will try to bind to the property given by evaluating the expression on the
current scope. If the property doesn't already exist on this scope, it will be created
implicitly and added to the scope.
For basic examples, how to use ngModel
, see:
<input ng-model> ... </input>as class
<input class="ng-model"> ... </input>