# Url api JSON object equal to firebase

**URL:** <https://forum.ionicframework.com/t/url-api-json-object-equal-to-firebase/112549>\
**Category:** ionic-v3\
**Created:** [November 18, 2017, 5:38am UTC](https://forum.ionicframework.com/t/url-api-json-object-equal-to-firebase/112549 "2017-11-18T05:38:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hatrek](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/hatrek/32/112669_2.png) [@hatrek](https://forum.ionicframework.com/u/hatrek)\
**Post date:** [November 18, 2017, 5:38am UTC](https://forum.ionicframework.com/t/url-api-json-object-equal-to-firebase/112549/1 "2017-11-18T05:38:59Z")

</div>

hello i try call object from api json and if equal to firebase json display

```auto
ionViewWillEnter(){ 
    this.http.get( this.url )
    .map(res => res.json())
    .subscribe(data => {
      this.items = [];
      // we've got back the raw data, now generate the core schedule data
      // and save the data for later reference
     //this.data = data;
      this.items.push(data);
      
     
    });   
    this.postSubscription = this.db.list('/posts',{
    query: {
      orderByChild: 'country',
      equalTo: this.items 
   
    }

```

---

<div class="post-metadata">

**Author:** ![Tommertom](https://avatars.discourse-cdn.com/v4/letter/t/ed8c4c/32.png) [@Tommertom](https://forum.ionicframework.com/u/Tommertom)\
**Post date:** [November 18, 2017, 6:18am UTC](https://forum.ionicframework.com/t/url-api-json-object-equal-to-firebase/112549/2 "2017-11-18T06:18:49Z")

</div>

```auto
ionViewWillEnter(){ 
    this.http.get( this.url )
    .map(res => res.json())
    .subscribe(data => {
      this.items = [];
      // we've got back the raw data, now generate the core schedule data
      // and save the data for later reference
     //this.data = data;
      this.items.push(data);
      
     
    },_=>{},_=>{

this.db.list('/posts',{
    query: {
      orderByChild: 'country',
      equalTo: this.items 
   
    }

});   

```

You are never calling this.postSubscription. And there is more to ask about your code, but I leave that to others

---

<div class="post-metadata">

**Author:** ![hatrek](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/hatrek/32/112669_2.png) [@hatrek](https://forum.ionicframework.com/u/hatrek)\
**Post date:** [November 18, 2017, 6:36am UTC](https://forum.ionicframework.com/t/url-api-json-object-equal-to-firebase/112549/3 "2017-11-18T06:36:38Z")

</div>

Thanks i try your code

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 10:03pm UTC](https://forum.ionicframework.com/t/url-api-json-object-equal-to-firebase/112549/4 "2021-07-19T22:03:30Z")

</div>

Closed on July 19, 2021, 10:03pm UTC


