12
Oct
2018
AngularJS – Data Binding
/
What is data binding in AngularJS?
AngularJS application is displayed in Hyper Text Markup Language container which is also representing a view. Data Binding is simply used to communication between view and model.
For Example :
<div ng-app=”NewModule” ng-controller=”NewController”>
<p ng-bind=”studentName”></p>
</div>
<script>
var app = angular.module(‘NewModule’, []);
app.controller(‘myCtrl’, function($scope) {
$scope.studentName = “alok”;
$scope.studentId = “1″;
});
</script>
Output: – alok