r
<!DOCTYPE html>
<html ng-app="studentApp">
<head>
<script
</head>
<body ng-controller=" studentController">
<h1>Student Information:</h1>
<form ng-submit="submitStudnetForm() " >
<label for="firstName" >First Name: </label><br />
<input type="text" id="firstName" ng-model="student.firstName" /><br />
<label for="lastName">Last Name</label><br />
<input type="text" id="lastName" ng-model="student.lastName" /><br />
<label for="dob" >DoB</label><br />
<input type="date" id="dob" ng-model="student.DoB" /><br /><br />
<label for="gender" >Gender</label><br />
<select id="gender" ng-model="student.gender">
<option value="male">Male</option>
<option value="female">Female</option>
</select><br /><br />
<span>Training Type:</span><br />
<label><input value="online" type="radio" name="training" ngmodel="student.trainingType" />Online</label><br />
<label><input value="onsite" type="radio" name="training" ngmodel="student.trainingType" />OnSite</label><br /><br />
<span>Subjects</span><br />
<label><input type="checkbox" ng-model="student.maths" />Maths</label><br />
<label><input type="checkbox" ng-model="student.physics" />Physics</label><br />
<label><input type="checkbox" ng-model="student.chemistry" />Chemistry</label><br /><br />
<input type="submit" value="Submit" />
<input type="reset" ng-click="resetForm()" value="Reset" /><br />
</form>
<script>
varstudentApp angular.module('studentApp', []);
studentApp.controller(" studentController", function ($scope, $http) )
$scope.originalStudent = { firstName: 'Vrushali', lastName: 'Ghatpande', DoB: new
Date('01/31/1980'), gender: 'female', trainingType: 'online', maths: false, physics: true, chemistry: true
};
$scope.student = angular.copy($scope. originalStudent);
$scope.submitStudnetForm = function () {
};
$scope.resetForm = function () {
$scope.student = angular.copy($scope. OriginalStudent);
};
</script>
</body>
</html>
Comments
Post a Comment