Desired result is when user input data into the input field, it will dynamically display user's name below. eg. When a user name Sally input her name in the input field, in the below it will instantly show her name. Any idea?Thanks
var app = angular.module('app', []);
app.controller('PersonCtrl', function(){
//...
this.name ='tom';
this.test ='mary';
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js"></script>
<html ng-app="app">
<head>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap.min.css">
</head>
<body>
<div class="well span6" ng-controller="PersonCtrl as tim">
<label>Name1:</label>
<input type="text" ng-model="name">
<hr>
<label>Name2:</label>
<input type="text" ng-model="test">
<br>Name1: {{tim.name }}<br>
Name2: {{tim.test }}
</div>
</body>
</html>