title: Trouble changing a globale variable from an event handler
body: <p>I´m builing a simple app in ionic4 that has a button. When the button is pressed then the accelerometer alpha value should be displayed. My problem is that the eventhandler that the event listner invokes does not change the globale variable (I think)</p>
  
  <pre><code>public sensordata: any;
  
  handleOrientation(event) {
  this.sensordata = event.alpha;
  }
  
  clicked() {
  window.addEventListener("deviceorientation", this.handleOrientation, true);
  }
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;ion-button id="btn" (click)="clicked()" expand="block"&gt;Show sensor data&lt;/ion-button&gt;
  &lt;ion-text&gt;The sensor data is {{sensordata}}&lt;/ion-text&gt;
  </code></pre>