Sunday, February 15, 2015

ng-model directive

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>

Output:


Search Flipkart Products:
Flipkart.com

No comments: