title: Angular - Property does not exist on type
body: <p>I am new to Angular. I took the following example from a book, to get familiar with javascript classes. I try to load it using main.ts . However, I get the following error: <em><strong>error TS2551: Property '_weather' does not exist on type 'MyClass'. Did you mean 'weather'?</strong></em> Can anybody explain me why? It should work, it is a copy/paste from a book. I can make it work if I manually add _weather: string; and name: string; declarations. But it shouldn't be necessary.</p>
  <pre><code> class MyClass {
          constructor(name, weather) {
              this.name = name;
              this._weather = weather;
          }
          set weather(value) {
              this._weather = value;
          }
          get weather() {
              return `Today is ${this._weather}`;
          }
          printMessages() {
              console.log(&quot;Hello &quot; + this.name + &quot;. &quot;);
              console.log(this.weather);
          }
      }
      let myData = new MyClass(&quot;Adam&quot;, &quot;sunny&quot;);
      myData.printMessages();
  </code></pre>