title: Angular's constructor can't see the declared objects
body: <p>I got a strange Angular's (v9) behavior:</p>
  
  <p>I have the following code:</p>
  
  <pre><code>public devices = [];
  
  constructor(...){
    navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {
        navigator.mediaDevices.enumerateDevices().then(p =&gt; this.devices = this.gotDevices(p));
    });
  }//end of constructor
  
  public gotDevices(deviceInfos){...}
  </code></pre>
  
  <p>Previously it worked now I get the error message saying: </p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'gotDevices' of undefined</p>
  </blockquote>
  
  <p>Then I tried to modify the code in the following way:</p>
  
  <pre><code>public mydevices = [];
  
  constructor(...){
  let tempDevices = [];
  
  navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {
       navigator.mediaDevices.enumerateDevices().then(function (devices) {
       devices.forEach(function (device) {
           tempDevices.push(mydevice);
           this.mydevices.push(mydevice);
      }
      });
      });
      }).catch(function (err) {
      });
  </code></pre>
  
  <p>If I use this code then it can see the array tempDevices and it can use it but it still can't see this.mydevices and throws the same exception as above.</p>
  
  <p>Why is that?</p>