1.HTML control: The following HTML INPUT element is called an HTML control:
**input elements
**select elements
**button elements
**textarea elements
2.AngularJS Form instances:
<div ng-app= "myApp" ng-controller= "Formctrl" >
<form novalidate>//novalidate property is New in HTML5, disables default validation using the browser
First name:<br>
<input type= "text" ng-model= "User.firstname" ></br>//ng-model directive binds two input elements to the model's user object
Last name:<br>
<input type= "text" ng-model= "User.lastname" >
<br><br>
<button ng-click= "Reset ()" >RESET</button>
</form>
<p>form={{user}}</p>
<P>master={{master}}</P>
</div>
<script>
var app=angular.module (' myApp ', []);
App.controller (' Formctrl ', function ($scope) {//formctrl functions set the initial value of the Master object and defines the reset () method
$scope. Master={firstname: "John", LastName: "Doe"}
$scope. Reset=function () {//reset () method sets the user object equal to the Master object
$scope. User=angular.copy ($scope. Master)
};
$scope. Reset ();
});
</script>
Angularjs Learning Form