OutPut:
Change First and Last names inside the input fields, and the model will change automatically.
Enter First Name:
Enter Last Name:
Enter Last Name:
{{firstname + " " + lastname}}
<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myController">
Enter First Name: <input ng-model="firstname">
<br/><br/>
Enter Last Name: <input ng-model="lastname">
<h1 style="color:green">{{firstname + " "+lastname}}</h1>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myController', function($scope) {
$scope.firstname = "Vara";
$scope.lastname = "Reddy";
});
</script>
</body>
</html>