Data-binding in AngularJs refers to the synchronization of data b/w the model and view components.
When the model changes i.e if user changes in something then the view reflects the changes done.
So in below example i am demonstrating you the concept of data binding in AngularJs:-
<!DOCTYPE html>
<html lang="en">
<title>Angular Directives</title>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app>
<p>Enter Your Name : <input type="text" ng-model="name"></p>
<p>Hello {{name}} !</p>//Data Binding
</div>
</body>
</html>
As in above example, you can check, how the model value is wrapped inside the binding expression {{name}}.
So in AngularJs we can bind to the value using the double braces {{ with }}.
0 Comment(s)