The
core functionality of ng-model
directive is to provides data binding between the model and the view in
AngularJS. The ng-bind directive additionally
provides validation, state management functionality.
The below example provides a basic implementation of data binding using ng-model
<html ng-app>
<head>
<meta charset="utf-8" />
<title>AngularJS - Basic</title>
<script src="angular.min.js"></script>
</head>
<body>
<div ng-init="Name='FirstName, LastName'">
Enter Name: <input type="text" ng-model="Name"><br/><br/>
Your Name is :{{Name}}
</div>
</body>
</html>
The below example provides a basic implementation of data binding using ng-model
<html ng-app>
<head>
<meta charset="utf-8" />
<title>AngularJS - Basic</title>
<script src="angular.min.js"></script>
</head>
<body>
<div ng-init="Name='FirstName, LastName'">
Enter Name: <input type="text" ng-model="Name"><br/><br/>
Your Name is :{{Name}}
</div>
</body>
</html>
Output:
No comments:
Post a Comment