title: Calling arrays in Firebase using Angular 2
body: <p>I would like to know how to call a Firebase array using Angular 2. In my example here, I have an array <code>addnote</code> in my Firebase DB. There are two separate iterations of <code>Do the dishes</code>, and I would like to print them out to my HTML's unordered list. </p>
  
  <p>The <code>[]</code> in my <code>private addsnotes</code> throws errors, and I didn't really expect otherwise. In the absence of understanding how to output the array, I am using it to illustrate what I am trying to achieve. I have also marked the relevant area where the call is being made. </p>
  
  <p>My <strong>rainbow.component.html</strong></p>
  
  <pre><code>&lt;div&gt;&lt;ul&gt;
      &lt;li *ngFor="let addsnote of addsnotes"&gt;{{addsnote}}&lt;/li&gt;
  &lt;/ul&gt;&lt;/div&gt;
  </code></pre>
  
  <p>My <strong>firebase</strong> schema:
  <a href="https://i.stack.imgur.com/sm66C.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sm66C.jpg" alt="enter image description here"></a></p>
  
  <p>My <strong>rainbow.component.ts</strong></p>
  
  <pre><code>export class Rainbow implements OnInit{
  private addsnotes: [];
  private username: string;
  
  ngOnInit(){
      var self = this;
      var user = firebase.auth().currentUser;
      var getUserInfo = firebase.database().ref('users/' + user.uid); 
      setTimeout(acquisition, 1000);
  
      function acquisition(){
      if (user){
          getUserInfo.once('value', function(snapshot){
                  self.username = snapshot.val().username;
                  self.addsnotes = snapshot.val().addnote; //incorrect
              });     
          }
      }
  }
  
  }
  </code></pre>