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

grouped codepen

<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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -