json - AngularJS Filter for comma separated values -


i have 1 column in database has comma separated values example table:

enter image description here

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:

enter image description here

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

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -