第一批过滤器
'use strict';
app.filter('first', function(){
return function(object){
var first = first_element_of_object;
return first;
}
});
删除第一个过滤器
'use strict'
app.filter('removeFirst', function(){
return function(object){
var new_one = after_remove_first_element_of_object;
return new_one;
}
});
HTML代码
<tr ng-repeat="row in rows">
<td>{{$index + 1}}</td>
<td ng-repeat="(key, value) in row | removeFirst">{{value}}</td>
<td>
<ul ng-init="id = row | first">
<li ng-repeat="option in options">
<a ng-href="{{option.link}}/{{id}}" class="btn btn-default">{{option.name}}</a>
</li>
</ul>
</td>
</tr>
这是行:
[
{"educationBoardId":1,"educationBoardName":"Dhaka"},
{"educationBoardId":3,"educationBoardName":"Manikganj"}
]
问题1:我如何获得对象的第一个元素?
问题2:我如何删除对象的第一个元素??