title: Angular 2 : cannot read property 'push' of undefined
body: <p>In my Angular 2 application I have a function : </p>
  
  <pre><code>notification : Array&lt;any&gt;;
  ......
  ......
   getNotification () {
       return setTimeout(() =&gt; {
           this.AppbankService.notify(this.user.NameId)
       .subscribe(
           (response) =&gt; {
               if (response.status === 200) {
               this.notifications.push(response.json());
               console.log(typeof(this.notifications));
                }
               this.getNotification();
           }
       )
       },5000)}
  </code></pre>
  
  <p>In this function, I get notification from the server every 5 seconds and try to push them to an array, but a have this:</p>
  
  <blockquote>
    <p><strong>error app.module.ts:104 error :  TypeError: Cannot read property 'push' of undefined(…)</strong></p>
  </blockquote>
  
  <p>Any suggestion? </p>