AngularJS data binding with expression
Angular data binding with the source as an expression
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
<body ng-app="SampleMVCApp">
<div ng-controller="SampleController">
<h2>{{getText}}</h2>
<input type='button' ng-click='changeText()'>
</div>
</body>
JavaScript
angular.module("SampleMVCApp", [])
.controller("SampleController", function ($scope) {
$scope.getText ='hi1';
$scope.changeText=function(){
$scope.getText ='hi2';
}
});