title: Cannot set property stack of [object Object] which has only a getter
body: <p>I am getting the following error in the following plunker.</p>
  
  <blockquote>
    <p>Cannot set property stack of [object Object] which has only a getter</p>
  </blockquote>
  
  <p>Plunker is here 
  <a href="https://plnkr.co/edit/IP1ssat2Gpu1Cra495u2?p=preview" rel="noreferrer">https://plnkr.co/edit/IP1ssat2Gpu1Cra495u2?p=preview</a></p>
  
  <p>Code is as follows:</p>
  
  <pre><code>//our root app component
  import {Component, NgModule, OnInit, Injectable} from '@angular/core'
  import {BrowserModule} from '@angular/platform-browser'
  import { HttpModule, Http } from '@angular/http';
  import 'rxjs/add/operator/toPromise';
  
  class MyModel {
    public name: string;
    public value: string;
  }
  
  @Injectable()
  export class MyService {
  
    constructor(public http: Http) {
  
    }
  
    getData (request: MyModel):Promise&lt;MyModel&gt;{
      return this.http.get('https://run.plnkr.co/j2Cw0yaD5Dn7ENaR/mymodel.json')
                  .toPromise()
                  .then(response =&gt; {
                                  return response as MyModel;
                          });
    }
  }
  
  @Component({
    selector: 'my-app',
    template: `
      &lt;div&gt;
        &lt;h2&gt;Hello {{name}}&lt;/h2&gt;
      &lt;/div&gt;
    `,
  })
  export class App implements AfterViewInit {
    name:string;
  
    constructor(myService : MyService) {
      this.name = 'Angular2'
    }
  
    ngAfterViewInit(){
  
      let myModelObj : MyModel = new MyModel();
      console.log(this.myService);
      this.myService.getData(myModelObj)
        .then(response =&gt; {
          console.log('GET Request success')
          console.log(response);
        });
  
    }
  }
  
  @NgModule({
    imports: [ BrowserModule, HttpModule ],
    declarations: [ App ],
    providers : [MyService],
    bootstrap: [ App ]
  })
  export class AppModule {}
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>I am able to understand the error is here </p>
  
  <pre><code>this.myService.getData(myModelObj)
            .then(response =&gt; {
              console.log('GET Request success')
              console.log(response);
            });
  </code></pre>
  
  <p>If I comment this 4 lines then it is working fine. Please help.</p>