1

========================================================

<!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...

1 Answer 1

2

This works when you put in an email address. I think it looks for the '@' character. The type='email' filters out data that doesn't match the type.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.