title: TypeScript setter not triggered
body: <p>I have the following class</p>
  <pre><code>export class VibrationElement {
  
      private _amplitude: number;
  
      get amplitude(): number {
          return this._amplitude;
      }
  
      set amplitude(amplitude: number) {
          console.log(&quot;test&quot;);
          if (this.validate(amplitude)) {
              this._amplitude = amplitude;
          }
      }
  
  }
  </code></pre>
  <p>When I define an instance of that class in a component:</p>
  <pre><code>export class VibrationPatternEditingComponent {
      
      ...
  
      amplitudeChange(vibration: VibrationElement, newValue: any) {
          vibration.amplitude = parseInt(newValue);
      }
  
  }
  </code></pre>
  <p>So the problem here is that the setter of VibrationElement is not called (no &quot;test&quot; in console) but the value changes anyway. But I need to verify some constraints on the amplitude so the setter is necessary.</p>
  <p>I also tried it with
  <code>Object.assign(vibration, {amplitude: parseInt(newValue)});</code> but that also did not trigger the setter.</p>
  <p>When I use <code>[(ngModel)]=&quot;vibration.amplitude&quot;</code> inside an input form then the setter gets triggered but the problem here is that the input then is a string. And then I can't convert it in the setter because the setter of course gets a number but somehow it is a string when I console log <code>typeof amplitude</code> inside the setter. I really don't get it. Does somebody has an answer here?</p>