See below examples of AngularJS code:
Ex. 1:
<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="" ng-init="quantity=1;cost=5">
<p>Total in dollar: <span ng-bind="{{quantity * cost}}"></span></p>
</div>
</body>
</html>
Output of above program is: Total in dollar: 5
Ex. 2:
<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="" ng-init="firstName='John';lastName='Doe'">
<p>The full name is: <span ng-bind="{{firstName + ' ' + lastName}}"></span></p>
</div>
</body>
</html>
Output of above program is: The full name is:
Why the full name is not appearing in output of second program?