json - AngularJS Filter for comma separated values -
i have 1 column in database has comma separated values example table:
now want filter in angularjs application.
i can filter name , etc, whoever column has 1 single string. however, i'm having difficulty sort if have sort fruits.
for example: want sort orange, likes apple , etc. , stuck this. perhaps can me.
here code in html file:
<div class="col s12"> <div class="col s12 input-field"> <select ng-model="global.fruitfilter" ng-options="tp.fruits tp.fruits tp in tables= (table | filter: {region: global.name||undefined, cluster: global.amount||undefined :true) | unique:'fruit'" material-select watch> <option value="">select fruit</option> </select> </div> </div>
i using ng-options here everytime select fruit, table adapt person has fruit example if pick apple, table show data likes apple: (rita, eve).
i have button on homepage filtering data on table:
how can achieve this? i'm using 1 json file
{"id":1,"name":"rita",fruits":["apple"],["banana"],["guava"],"created_at":"2016-08-18 12:33:14","updated_at":"2016-09-22 13:54:01"}
i new in angularjs 1. kindly me.
Comments
Post a Comment