title: Add new object to array angular
body: <p>I'm trying to put a JSON object into an array after an API call.</p>
  
  <p>First I made my API call and then I try to add every user into in a formatted JSON object.</p>
  
  <p><strong>connectionProvider.ts</strong></p>
  
  <pre><code>import { UserModelProvider } from './../user-model/user-model';
  import { MSAdal, AuthenticationContext, AuthenticationResult } from '@ionic-native/ms-adal';
  
  export class MsConnectionProvider {
    userInfo : UserModelProvider;
    users: UserModelProvider[];
  
   constructor(...) {}
  
  getUserInfo(){
      let header = new Headers({
        Authorization: this.accessToken;
      });
      let options = new RequestOptions({headers: header});
  
      this.usersSubscription = this.http.get("https://graph.microsoft.com/v1.0/groups/**ID**/members", options).map(res =&gt; res.json()['value']);
      this.usersSubscription.subscribe(res =&gt; {
        for (let user of res){
          this.addUserInfo(user.displayName, user.jobTitle, "something", user.mail);
        }
      });
    }
  
   addUserInfo(name, job, departement, mail){
      this.userInfo = new UserModelProvider;
  
      this.userInfo.name = name;
      this.userInfo.job = job;
      this.userInfo.departement = departement;
      this.userInfo.mail = mail;
  
      this.users.push(this.userInfo);
    }
  }
  </code></pre>
  
  <p><strong>userModelProvider.ts</strong></p>
  
  <pre><code>export class UserModelProvider {
    name: string;
    job: string;
    departement: string;
    mail: string;
    photo: any;
  }
  </code></pre>
  
  <p>The problem is when I try to push "this.userInfo = new UserModelProvider" into this.users array the function block and nothing happens.</p>
  
  <p>I certainly don't understand the class, can you help me?</p>
  
  <p>Thank you.</p>