title: Do I need a setter for two-way binding?
body: <p>I've created a checkbox with two-way binding to a getter. I don't have a setter because the getter will return a result of filtering of a list.</p>
  
  <p>Locally this solution works fine but after deployment I get the following error "Cannot set property myProperty of [object Object] which has only a getter at Object.handleEvent"</p>
  
  <pre><code>&lt;input type="checkbox" class="custom-control-input" id="myId" [(ngModel)]="myProperty" (change)="toggleSelection($event)"/&gt;
  
  public get myProperty(): boolean {
          return this.list.every(function(item: any) {
              return item.selected == true;
          });
      }
  
  toggleSelection(event) {
          this.list.forEach(h =&gt; (h.selected = event.target.checked));
      }
  
  </code></pre>
  
  <p>I try to understand what is going on. When I create a setter and remove the change event it will work after deployment. </p>
  
  <pre><code>&lt;input type="checkbox" class="custom-control-input" id="myId"[(ngModel)]="myProperty""/&gt;
  
      public set myProperty(checked: boolean) { 
          this.list.forEach(h =&gt; (h.selected = checked));
      }
      public get myProperty(): boolean {
          return this.list.every(function(item: any) {
              return item.selected == true;
          });
      }
  </code></pre>
  
  <p>Now I want to understand why the first implementation works locally.
  Locally I don't need a setter but after deployment (a build) it needs a setter.</p>