title: Firebase Angular 2 retrieving data from user table
body: <p>Below I have a signup code. This comes from a <a href="https://stackoverflow.com/questions/39716203/firebase-creating-extra-user-data-upon-account-creation/39716306#39716306">previous question</a> I had about adding data to a user's table upon account creation. The code is as follows:  </p>
  
  <pre><code>signup(){
    firebase.auth().createUserWithEmailAndPassword(useremail, userpassword)
     .then(function(response) {
        var updates = {};
        updates['/users/' + response.uid] = { email: useremail, password: userpassword, net_worth : 5000, username : 'Roy' };
        firebase.database().ref().update(updates);
  });
  }
  </code></pre>
  
  <p>To be clear, my schema should look something like:</p>
  
  <pre><code>email|''
  password|''
  username|'Roy'
  net_worth|'5000'
  </code></pre>
  
  <p>Now I would like to retrieve this information and place it in my profile component, this time retrieving that data. At the moment what I have is the following:</p>
  
  <p><strong>Profile Component</strong></p>
  
  <pre><code>export class ProfileComponent implements OnInit {
  private usermail: string;
  private net_worth: string;
  constructor(){}
  
  ngOnInit(){
    this.usermail = '';
    this.net_worth = '';
    var user = firebase.auth().currentUser;
    if (user != null) {this.usermail = user.email;}
  }    
  }
  </code></pre>
  
  <p>This code works for giving me the user's email from authentication, but it won't work in returning the other information in my schema, like <code>net_worth</code> and <code>username</code>. I imagine because it is stored in the database table, not the authentication function.   </p>
  
  <p>How would I call the user-generated ID to get the details of the specified user? Specifically, their <code>username</code> and <code>net_worth</code>?</p>