javascript - How to show json response values in Angular JS using ng-repeat -
i'm trying show values of specific json in right order. json looks :
{ "a":[{"id":"21","name":"andrea"},{"id":"22","name":"apple"}], "b":[{"id":"21","name":"baby"},{"id":"22","name":"bali"}], "c":[{"id":"21","name":"candle"},{"id":"22","name":"canada"}], }
how show values ng-repeat :
<div ng-repeat="item in items"> </div>
like :
a
andrea
apple
b
baby
bali
c
candle
canada
please check working example: http://plnkr.co/edit/lqoqvmxnimwyzqvu0wkg?p=preview
html
<div ng-repeat="(key, values) in items"> {{key}} <div ng-repeat="item in values"> {{item.name}} </div> </div>
Comments
Post a Comment