I have the following code :
<div id="App2" ng-app="namesList" ng-controller="NamesController" ng-init="firstName='John';lastName='Doe'">
First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
<br>
Full Name: {{firstName + " " + lastName}}<Br>
The name is : <p><span ng-bind="firstName" /span></p>
<p><span ng-bind="lastName" /span></p>
</div>
In the 1st case it shows up correctly, but the 2nd case breaks the names into 2 lines, if I remove the <P>
and </P>
, it won't show, so how to use ng-bind to display the names in one line ?
You need to fix those
span
s:(they were closed incorrectly)