Javascript ng重复添加空白<;tr>;
我是Angular的新手,我正在尝试通过使用Javascript ng重复添加空白<;tr>;,javascript,html,angularjs,Javascript,Html,Angularjs,我是Angular的新手,我正在尝试通过使用ng repeat生成来创建一个表 我的控制器 .controller('ContactCtrl', ['$scope', 'Contact', function($scope, Contact) { $scope.contacts = Contact.query(); } ]) 我的工厂 .factory('Contact', ['$resource', 'ENV', function($resource,
ng repeat
生成
来创建一个表
我的控制器
.controller('ContactCtrl', ['$scope', 'Contact',
function($scope, Contact) {
$scope.contacts = Contact.query();
}
])
我的工厂
.factory('Contact', ['$resource', 'ENV',
function($resource, ENV) {
return $resource(ENV.apiEndpoint, {}, {
query: { method:'GET', isArray:true }
// create: { method:'POST', }
})
}
]);
我的部分
<table class="table table-striped">
<thead>
<tr>
<th>first name</th>
<th>last name</th>
<th>phone</th>
<th>email</th>
<th>address</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="contact in contacts | filter:searchParams | orderBy:orderProp">
<td>{{contact.first_name}}</td>
<td>{{contact.last_name}}<td>
<td>{{contact.phone_number}}<td>
<td>{{contact.email}}<td>
<td>{{contact.address}}<td>
<tr>
</tbody>
</table>
名字
姓
电话
电子邮件
地址
{{联系人.名字}
{{联系人.姓氏}
{{联系电话}
{{contact.email}
{{contact.address}
现在由于一些奇怪的原因,这是html,我得到了正确的东西,但是有空的
元素
<table class="table table-striped">
<thead>
<tr>
<th>first name</th>
<th>last name</th>
<th>phone</th>
<th>email</th>
<th>address</th>
</tr>
</thead>
<tbody>
<!-- ngRepeat: contact in contacts | filter:searchParams | orderBy:orderProp --><tr ng-repeat="contact in contacts | filter:searchParams | orderBy:orderProp" class="ng-scope">
<td class="ng-binding">testing</td>
<td class="ng-binding">Test</td><td>
</td><td class="ng-binding"></td><td>
</td><td class="ng-binding">me@asdfa.ca</td><td>
</td><td class="ng-binding"></td><td>
</td></tr><!-- end ngRepeat: contact in contacts | filter:searchParams | orderBy:orderProp --><tr ng-repeat="contact in contacts | filter:searchParams | orderBy:orderProp" class="ng-scope">
<td class="ng-binding">stuff</td>
<td class="ng-binding">Test</td><td>
</td><td class="ng-binding"></td><td>
</td><td class="ng-binding">me@asdfa.ca</td><td>
</td><td class="ng-binding"></td><td>
</td></tr><!-- end ngRepeat: contact in contacts | filter:searchParams | orderBy:orderProp --><tr ng-repeat="contact in contacts | filter:searchParams | orderBy:orderProp" class="ng-scope">
<td class="ng-binding">bob</td>
<td class="ng-binding">Test</td><td>
</td><td class="ng-binding">778-714-3492</td><td>
</td><td class="ng-binding">me@asdfa.ca</td><td>
</td><td class="ng-binding">1231 comce</td><td>
</td></tr><!-- end ngRepeat: contact in contacts | filter:searchParams | orderBy:orderProp --><tr>
</tr></tbody>
</table>
名字
姓
电话
电子邮件
地址
测试
试验
me@asdfa.ca
东西
试验
me@asdfa.ca
上下快速移动
试验
778-714-3492
me@asdfa.ca
1231康斯
这里发生了什么?为什么有多个空的
关闭您的``
像
{{联系人.名字}
{{联系人.姓氏}
{{联系电话}
{{contact.email}
{{contact.address}
close your `<td>`
<tr ng-repeat="contact in contacts | filter:searchParams | orderBy:orderProp">
<td>{{contact.first_name}}</td>
<td>{{contact.last_name}}</td>
<td>{{contact.phone_number}}</td>
<td>{{contact.email}}</td>
<td>{{contact.address}}</td>
</tr>