ProgrammerGuide.Net | Step by Step Programmer Guide

AngularJS Expressions with Strings by Example | AngularJS Interview Question | AngularJS Programmer Guide and Tutorials

AngularJS expressions are written inside double braces: {{ expression }}. AngularJS strings are like JavaScript strings.

<div ng-app=“” ng-init=“firstName=’John’;lastName=’Doe'”>


<p>The name is {{ firstName + ” ” + lastName }}</p>


</div>

We can also rewrite the above code using ng-bind as below:

<div ng-app=“” ng-init=“firstName=’John’;lastName=’Doe'”>


<p>The name is <span ng-bind=“firstName + ‘ ‘ + lastName”></span></p>


</div>

Please click here for related products on Amazon!

Jayashee

Add comment

Want to Check Celebrities News?