javascript - How to group and display the values in angular js -
i have created scope function
$scope.sample = [ {'supname':'aaa','supcode':'22671','slipno':'18384','desg':'1','iv':'1'}, {'supname':'aaa','supcode':'22671','slipno':'18384','desg':'2','iv':'2'}, {'supname':'aaa','supcode':'22671','slipno':'18384','desg':'3','iv':'3'}, {'supname':'bbb','supcode':'24603','slipno':'26714','desg':'1','iv':'4'}, {'supname':'bbb','supcode':'24603','slipno':'26714','desg':'2','iv':'5'}, {'supname':'bbb','supcode':'24603','slipno':'26714','desg':'3','iv':'6'}, ]
i have display grouping same supname,supcode,slipno. example have display this.
supname:aaa supcode=22671 desg 1 desg2 desg 3 supname:bbb supcode=24603 desg 1 desg2 desg 3
so how can create ng-repeat this..kindly give solution.
i tried create codepen case
<table class="table table-striped"> <tr><td>{{data1}}</td><td>{{data2}}</td></tr> <tr ng-repeat="item in filteredsample = (sample | filter:{ supname: 'aaa'})"> </tr> <ul ng-repeat="thing in filteredsample"> <li style = "float:left; margin:20px">desg value {{$index}} = {{thing.desg}}</li> </ul> </div>
hope helps
Comments
Post a Comment