title: Typescript Subscribe method return
body: <p>I have little problem with returning subscribe array in NG2.</p>
  
  <p>I am newbie in typescript and I can't understand how to transfer vars between functions and constructor.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>export class RosterPage extends Page {
  
      roster:Roster[];
      players:Players[];
  
  
      roster_data:any;
  
      constructor(private location: Location, private playersService: PlayersService) {
          super(location);
  
          this.players = [];
          this.roster = [];
  
  
          this.roster_data = this.getRoster();
  
          for (let i of this.roster_data) {
              console.log(i); // I need iterate 
  
  
     getRoster() {
          return this.playersService.getRoster("2017","MUZ").subscribe(roster =&gt; {
              this.roster = roster["soupiska"];
          });
      }
  
  
  }
  </code></pre>