title: How to get Object from database using it's Key?
body: <p>I want to get an Object from database using it's key, but it is not working.</p>
  
  <p>Here is my database : </p>
  
  <p><a href="https://i.stack.imgur.com/kZrq4.png" rel="nofollow noreferrer">DATABASE</a></p>
  
  <p>DATABASE:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>...
   - toc-list
             |___ id1 (generated by firebase)
                    |___ field1
                    |___ field2
  
             |___ id2 (generated by firebase)
                    |___ field1
                    |___ field2
  
             |___ id3 (generated by firebase)
                    |___ field1
                    |___ field2</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am trying to get an Object from toc-list by using the id1 "-Ld6AAdHn6JBYcrh29Xz"</p>
  
  <p>I have tried to get it like this, but it is not working :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { Component } from '@angular/core';
  import { IonicPage, NavController, NavParams } from 'ionic-angular';
  
  import firebase from 'firebase';
  import { AngularFireDatabase, AngularFireList } from 'angularfire2/database';
  
  @IonicPage()
  @Component({
    selector: 'page-confrontation-1',
    templateUrl: 'confrontation-1.html',
  })
  export class Confrontation_1Page {
  
    toc_id : string;
    public toc: Array&lt;any&gt; = [];
    public tocRef: firebase.database.Reference = firebase.database().ref('/toc-list');
  
    constructor(public navCtrl: NavController, public navParams: NavParams, public afDB: AngularFireDatabase) {
      this.toc_id = navParams.get('tocId');
    }
  
    ionViewDidLoad() {
      console.log('ionViewDidLoad Confrontation_1Page');
  
      // I want to show the details of the element that has the id : toc_id
      console.log(this.afDB.object('/toc-list/' + this.toc_id));
  
    }
  
  
  }</code></pre>
  </div>
  </div>
  </p>