========================================================
<!DOCTYPE html><html><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content=""><meta name="author" content="">
<link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="/css/main.css" rel="stylesheet" media="screen">
<link href="/css/font-awesome.min.css" rel="stylesheet" media="screen">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"> </script>
<script src="js/bootstrap.min.js"></script><script src="js/main.js"></script></head><body>
<style>
form {width: 300px;}
</style>
<div ng-app="registerapp">
<div ng-controller="ngController">
<form novalidate class="simple-form">
<input type="text" ng-model="user.name" class="form-control" placeholder='Enter Username' /><br />
<input type="password" ng-model="user.password" class="form-control" placeholder='Enter password' /><br />
<input type="email" ng-model="user.email" class="form-control" placeholder='Enter Email'/><br />
<input type="test" ng-model="user.test" class="form-control" placeholder='Enter whatever'/><br />
Gender: <input type="radio" ng-model="user.gender" value="male" />male
<input type="radio" ng-model="user.gender" value="female" />female<br />
<button ng-click="reset()" class="btn btn-primary">RESET</button>
<button ng-click="update(user)" class="btn btn-primary">Submit</button>
<button ng-click="reset()" class="btn btn-default">Cancel</button>
</form>
<pre>form = {{user | json}}</pre>
<pre>master = {{master | json}}</pre>
</div>
</div>
<script>
var registerapp = angular.module('registerapp', []);
registerapp.controller("ngController", function Controller($scope) {
$scope.master = {};
$scope.update = function(user) {
$scope.master = angular.copy(user);
};
$scope.reset = function() {
$scope.user = angular.copy($scope.master);
};
$scope.reset();
});
==================================================
with above testing code.
other values sysc with {user: json} ..
only email doesn't sync with bottom part. ..
what's wrong ?
I don't understand...