<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
Name: <input ng-model="name">
<h1>You entered: {{name}}</h1>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.name = "John Doe";
});
</script>
<p>Change the name inside the input field, and you will see the name in the header changes accordingly.</p>
</body>
</html>
// Code goes here
/* Styles go here */
<div>
w3s109-AngularJS Model Two-Way Data Binding
<br/>
code example:
<hr>
index.html
<br/>
<textarea
id='codeoutput'
style="width: 100%;height: 300px;background-color: #dffff4;
font-size: 1em;font-family: Verdana, Arial, Helvetica, sans-serif;
border: 1px solid black;">
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
Name: <input ng-model="name">
<h1>You entered: {{name}}</h1>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.name = "John Doe";
});
</script>
<p>Change the name inside the input field, and you will see the name in the header changes accordingly.</p>
</body>
</html>
</textarea>
<hr/>
<iframe
allowfullscren="allowfullscren"
frameborder="0"
src="https://embed.plnkr.co/Py8Cwg18EHmuxSzJG03u?show=preview"
style="height: 400px; width: 100%;">
</iframe>
<hr>
https://www.w3schools.com/angular/angular_model.asp
<hr>
201603
</div>