Ng-Form-1

 

We create a form using ng-form directive.When we fill the fields of form and click on the submit button fields with data will display and form will hide basis on the true,false value of isDetail variable.

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> </head> <body ng-app> <div> <ng-form ng-hide="isDetail"> First Name: <input type="text" ng-model="fName"> <br /> Last Name: <input type="text" ng-model="lName"> <br /> User Name: <input type="text" ng-model="uName"> <br /> Password: <input type="password" ng-model="password"> <br /> </ng-form> <input type="button" ng-click="isDetail=true" value="Submit" /> <div ng-show="isDetail"> First Name:<b>{{fName}}</b><br /> Last Name:<b>{{lName}}</b><br /> User Name:<b>{{uName}}</b><br /> Password:<b>{{password}}</b> </div> </div> </body> </html>
Output