title: Prevent closing of Angular Material Dialog when escape button is pressed but allow closing when backdrop is clicked
body: <p>By default, when the <kbd>esc</kbd> button is pressed, the dialog closes. However, I don't want this intended behaviour.</p>
  
  <p>What I would like to happen is to prevent closing when the <kbd>esc</kbd> button is pressed but still allow a click on the backdrop to close the dialog. How can this be done?</p>
  
  <p>I've tried something like this. However, it doesn't work:</p>
  
  <pre class="lang-ts prettyprint-override"><code>openEditDialog() {
    const dialogRef = this.dialog.open(EditPlaceDialogComponent, {
      width: '90%',
      height: '720px'
    });
  
    dialogRef.keydownEvents().subscribe(e =&gt; {
      if (e.keyCode === 27) {
        e.preventDefault();
        dialogRef.disableClose = false;
      }
    });
  
    dialogRef.afterClosed().subscribe(result =&gt; {
      console.log('The dialog was closed');
    });
  }
  </code></pre>