The
ngModel
directive attaches the element to a property in the scope, thus binding the view to the model. In this case, the element can be input (all types), select, or textarea.
<input type="text" ng-model="employee.Name" placeholder="What's the plate?" />
The field that is using the
ngModel
directive is a part of the construction of an object every time, we must declare the object
in which the property should be attached.
In this case, the object that is being constructed is a employee; so, we will use employee.Name inside the directive expression. We can also use the
ngModel
directive without any object.