过滤器,我有以下Json_encode从PHP响应...AngularJS通过ID
[
{"ID":"149","IDusr":"4","aut_more_info":"good","doc_name":"img1838142879.jpeg","doc_type":"jpg"},{"ID":"149","IDusr":"4","aut_more_info":"good","img5733250433.jpeg","doc_type":"jpg"},{"ID":"149","IDusr":"4","aut_more_info":"good","doc_name":"img1230306801.jpg_doc","doc_type":"jpg"}
]
我已经尝试了https://github.com/a8m/angular-filter插件。这是我的代码。
<div ng-repeat="(key, value) in Detail | groupBy: 'ID'">
<div ng-repeat="aut in value">
<div class="item item-avatar bar bar-calm">
<h2>{{aut.name}} {{aut.model}}</h2>
</div>
<div class="item item-avatar">
<img src="../www/img/icon/{{aut.doc_name}}">
</div>
</div>
</div>
正如你从阵列看到,我有相同的ID,但DOC_NAME是不同的,意味着我要一次显示ID,但是这三个形象应显示为好。我怎样才能做到这一点?
在此先感谢...
id在n值重复前使用'{{key}}'。 – Ankita
你会创造一个蹲式或小提琴吗? – Vineet
您的JSON存在问题。 ''aut_more_info“:”好“,”img5733250433.jpeg“,'图像前应该有'doc_name'。 –