title: when accessing an object field using get method,value always undefined
body: <p>i wrote a TypeScript model and i wrote a get method :</p>
  
  <pre><code>get comments(): [any] {
    return this.commentsTest;
  }
  set comments(comments: [any]) {
    this.commentsTest = comments;
  }
  </code></pre>
  
  <p>the field it self is defined as private :</p>
  
  <pre><code>private commentsTest: [any];
  </code></pre>
  
  <p>in the constructor i initialized the object as follow :</p>
  
  <pre><code>this.comments = commentsTest;
  </code></pre>
  
  <p>when i am trying to use that field using the get method it is always undefined,
  but if i am accessing it directly(while getting access warning)
  i do get the values i am looking for :</p>
  
  <pre><code>openExtendedDetailsModal(comments) {
    console.log("***" + this.investorObject.comments); // undefined
    console.log(this.investorObject.commentsTest); // defined
    //this.commentsdDetails.altOpen(comments);
  }
  </code></pre>
  
  <p><strong>UPDATE</strong>
  here is the code i am using :</p>
  
  <pre><code>investorObject: Investor;
  prametersSubscription: Subscription;
  id: string;
  
  constructor(private investorService: InvestorsService, private route: ActivatedRoute) {}
  
  ngOnInit() {
    this.prametersSubscription = this.route.params.subscribe(
      (params: Params) =&gt; {
        this.id = params.id;
        this.getInvestorData();
      }
    );
  }
  
  ngOnDestroy() {
    this.prametersSubscription.unsubscribe();
  }
  
  getInvestorData() {
    this.investorService.getSingleInvestorById(this.id).subscribe(
      data =&gt; {
        this.investorObject = data.data;
        console.log(this.investorObject.commentsTest);
      });
  }
  
  openExtendedDetailsModal(comments) {
    console.log("***" + this.investorObject.lastName); // defined
    console.log("***" + this.investorObject.comments); // undefined
    console.log(this.investorObject.commentsTest); // defined
    //this.commentsdDetails.altOpen(comments);
  }
  </code></pre>
  
  <p>here is part of the Investor class :
  <a href="https://i.stack.imgur.com/wntC0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wntC0.png" alt="enter image description here"></a>
  what am i missing here ?</p>
  
  <p>Thanks </p>