<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-example32-production</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.0-beta.2/angular.min.js"></script>
</head>
<body ng-app="formExample">
<div ng-controller="ExampleController">
<form novalidate class="simple-form">
<h3>Shipping Address</h3>
Name:<input type="text" ng-model="sa.name" ng-change="sameAddress && update()" placeholder="in" /><br/>
Age:<input type="text" ng-model="sa.age" ng-change="sameAddress && update()" placeholder="age" />
<br /> Street:
<br />
<h3>Billing Address
<input type="checkbox" ng-model="sameAddress" ng-change="sameAddress && update()" />Copy
</h3>
Name:<input type="text" ng-model="ba.name" ng-disabled="sameAddress" placeholder="out" /><br/>
Age:<input type="text" ng-model="ba.age" ng-disabled="sameAddress" placeholder="age" />
<br />
<br />
</form>
</div>
<script>
angular.module('formExample', [])
.controller('ExampleController', ['$scope', function($scope) {
$scope.sa={}; //declaring sa object
$scope.ba={}; //declaring ba object
$scope.update = function() {
$scope.ba =angular.copy($scope.sa);
};
}]);
</script>
</body>
</html>
/* Styles go here */
Auther: Nilakantha Singh Deo
nsinghdeo005@gmail.com