我的代码就像这样
<body ng-app="">
<div ng-init="friends = [{name:'John', phone:'555-1276'},
{name:'Mary', phone:'800-BIG-MARY'},
{name:'Mike', phone:'555-4321'},
{name:'Adam', phone:'555-5678'},
{name:'Julie', phone:'555-8765'},
{name:'Juliette', phone:'555-5678'}]"></div>Name only
<input ng-model="search.name">
<br>
<h3>Results</h3>
<table id="searchObjResults">
<tr>
<th>Name</th>
<th>Phone</th>
</tr>
<tr ng-repeat="friendObj in friends | filter:search:strict">
name: <input ng-model="friendObj.name" />
<td>{{friendObj.name}}</td>
<td>{{friendObj.phone}}</td>
</tr>
</table>
当发生任何搜索时,我想将结果数据绑定到我提供的输入框。过滤正常,但我无法将其绑定到我的输入。它正确地绑定到<td>
。
的 Fiddle
谁能告诉我这里做错了什么?