Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy AngularJS Tutorials</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"> </script> </head> <body> <div ng-app="myApp" ng-controller="formCtrl"> <form> <h3>HTML Form in AngularJS</h3> Enter Name : <input type="text" ng-model="user.name"/><br><br> Select Gender : <input type="radio" ng-model="user.gender" value="Male"/> Male <input type="radio" ng-model="user.gender" value="Female"/>Female<br><br> Select Profession : <select ng-model="user.profession"> <option value="Student">Student <option value="Employee">Employee </select><br><br> <input type="checkbox" ng-model="user.agree"/> I Accept Terms and Conditions. <br><br> <button ng-click="reset()">RESET</button> </form> <h3 ng-show="user.name">Hello {{user.name}}</h3> <h3 ng-show="user.gender">You are Select : {{user.gender}}</h3> <h3 ng-show="user.profession">You are Select : {{user.profession}}</h3> <h3 ng-show="user.agree">Thank You for Accept our Terms And Conditions.</h3> </div> <script> var app = angular.module('myApp', []); app.controller('formCtrl', function($scope) { $scope.reset = function() { $scope.user ={name:"",gender:"",agree:"",profession:""}; }; }); </script> </body> </html>
www.wikitechy.com © Copyright 2016. All Rights Reserved.