# Keeping json id in new link

**URL:** <https://forum.ionicframework.com/t/keeping-json-id-in-new-link/30384>\
**Category:** cordova\
**Created:** [August 12, 2015, 3:22pm UTC](https://forum.ionicframework.com/t/keeping-json-id-in-new-link/30384 "2015-08-12T15:22:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lkpttrsn](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@lkpttrsn](https://forum.ionicframework.com/u/lkpttrsn)\
**Post date:** [August 12, 2015, 3:22pm UTC](https://forum.ionicframework.com/t/keeping-json-id-in-new-link/30384/1 "2015-08-12T15:22:23Z")

</div>

I am using an ng rpeat to get a list view from my returning json

```
<ion-list>
  <ion-item ng-repeat="category in feeds_categories"
        class="item-thumbnail-left item-icon-right"
        ui-sref="app.details">
    <img class="glow-pic" ng-src="{{category.image}}">
    <h2>{{category.title}}</span></h2>
    <p>{{category.listing}}</p>
    <p><small>{{category.distance}} Miles</small></p>
    <i class="icon ion-chevron-right"></i>
  </ion-item>
</ion-list>

```

When I click on the listing it takes takes me to the details page for that listing, I haven’t been able to figure out how to link this details page to the listing id so i can use the other returning json objects to populate this details and have it correspond to the reffering id.

Any help would be greatly appreciated

---

<div class="post-metadata">

**Author:** ![gmarziou](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gmarziou/32/13327_2.png) [@gmarziou](https://forum.ionicframework.com/u/gmarziou)\
**Post date:** [August 12, 2015, 4:24pm UTC](https://forum.ionicframework.com/t/keeping-json-id-in-new-link/30384/2 "2015-08-12T16:24:44Z")

</div>

As you did not show how your app.details state is defined, I’m guessing it could be:

```
ui-sref="app.details({ id: category.listing.id })"

```

Or [category.id](http://category.id) as you did not explain your objects

---

<div class="post-metadata">

**Author:** ![lkpttrsn](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@lkpttrsn](https://forum.ionicframework.com/u/lkpttrsn)\
**Post date:** [August 12, 2015, 7:16pm UTC](https://forum.ionicframework.com/t/keeping-json-id-in-new-link/30384/3 "2015-08-12T19:16:16Z")

</div>

```
 .state('app.details', {
url: "/details",
views: {
  'menuContent': {
    templateUrl: "details.html",
    controller: 'DetailsCtrl'
  }
}
```

---

<div class="post-metadata">

**Author:** ![gmarziou](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gmarziou/32/13327_2.png) [@gmarziou](https://forum.ionicframework.com/u/gmarziou)\
**Post date:** [August 12, 2015, 8:55pm UTC](https://forum.ionicframework.com/t/keeping-json-id-in-new-link/30384/4 "2015-08-12T20:55:49Z")

</div>

See the :id in url.

```
.state('app.details', {
    url: "/details/:id",
    views: {
      'menuContent': {
        templateUrl: "details.html",
        controller: 'DetailsCtrl'
      }
    }

```

May I suggest that you should read angular-ui router docs?

---

<div class="post-metadata">

**Author:** ![lkpttrsn](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@lkpttrsn](https://forum.ionicframework.com/u/lkpttrsn)\
**Post date:** [August 12, 2015, 9:45pm UTC](https://forum.ionicframework.com/t/keeping-json-id-in-new-link/30384/5 "2015-08-12T21:45:34Z")

</div>

Thank you for the start, I’ll do some more research, haven’t been able to get it working yet. Somewhere on the details page it is not loading in the json for the referring id

---

<div class="post-metadata">

**Author:** ![Gajotres](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gajotres/32/98564_2.png) [@Gajotres](https://forum.ionicframework.com/u/Gajotres)\
**Post date:** [August 13, 2015, 8:21am UTC](https://forum.ionicframework.com/t/keeping-json-id-in-new-link/30384/6 "2015-08-13T08:21:57Z")

</div>

@gmarziou They just keep coming 😄

@lkpttrsn Take a look at this tutorial: [http://www.gajotres.net/ionic-framework-tutorial-5-master-detail-pattern/](http://www.gajotres.net/ionic-framework-tutorial-5-master-detail-pattern/) It’s a showcase for Master Detail pattern in Ionic, it will also provide a working example. You can also find other tutorials under the **Table of Contents**.

---

<div class="post-metadata">

**Author:** ![lkpttrsn](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@lkpttrsn](https://forum.ionicframework.com/u/lkpttrsn)\
**Post date:** [August 13, 2015, 12:54pm UTC](https://forum.ionicframework.com/t/keeping-json-id-in-new-link/30384/7 "2015-08-13T12:54:08Z")

</div>

Thanks! I got it working yesterday. It’s ugly but the dog is hunting, I’ll read over your your materials, appreciate the info.

---

<div class="post-metadata">

**Author:** ![lkpttrsn](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@lkpttrsn](https://forum.ionicframework.com/u/lkpttrsn)\
**Post date:** [August 13, 2015, 1:06pm UTC](https://forum.ionicframework.com/t/keeping-json-id-in-new-link/30384/8 "2015-08-13T13:06:43Z")

</div>

Great tutorial, nailed it.
