Angular JS 如何在同一行显示 2 个 ng-bind 项?
In Angular JS how to display 2 ng-bind items on the same line?
我有以下代码:
<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>
在第一种情况下它显示正确,但第二种情况将名称分成两行,如果我删除 <P>
和 </P>
,它不会显示,所以如何使用 ng-bind 在一行中显示名称?
您需要修复那些 span
:
The name is :
<p><span ng-bind="firstName"></span> <span ng-bind="lastName"></span></p>
(它们被错误地关闭了)
我有以下代码:
<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>
在第一种情况下它显示正确,但第二种情况将名称分成两行,如果我删除 <P>
和 </P>
,它不会显示,所以如何使用 ng-bind 在一行中显示名称?
您需要修复那些 span
:
The name is :
<p><span ng-bind="firstName"></span> <span ng-bind="lastName"></span></p>
(它们被错误地关闭了)