javascript - repeat data on Ionic view? -


database :

`--> product table id  name      cid     uploadkey 1   cemera     1       7365 2   notebook   2       7222`  `--> category table id    catename 1      canon 2      toshiba`   `--> attactments table id      uploadkey       filepath 1       7365            /img/jdf.png 2       7365            /img/sdsd.jpg` 

this code create json file:

$_get['id']="1";  $json_response = array();     if(isset($_get['id']))     {         $id=$_get['id'];          $select = mysql_query("select product.name,category.catename,attactments.filepath product inner join category on category.id = product.cid inner join attactments on attactments.uploadkey = product.uploadkey product.id='".$id."'  ");     while ($row = mysql_fetch_array($select , mysql_assoc)) {                $json_response[] = $row;          }      }  echo $val= str_replace('\\/', '/', json_encode($json_response)); 

the result repeat information, how remove repeat want show below :

[{"name":"cemera","catename":"canon","filepath":"/img/jdf.png"},{"name":"cemera","catename":"canon","filepath":"/img/sdsd.jpg"}] 

code ionic show detail:

<ion-view>     <ion-content>         <ion-list class="list-inset">             <ion-item class="item-text-wrap" ng-repeat="x in detail  ">               <p> name : {{x.name}}</p>                  <p>  category : {{x.catename}}</p>                  <p>  filepath : {{x.filepath}}</p>                 <p>&nbsp;</p> </ion-item>         </ion-list>     </ion-content> </ion-view> 

the result in ionic show how solve problem

the result

i want show this:

  name: cemera   category : canon   filepath : /img/jdf.png              /img/sdsd.jpg` 


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 -