title: How to make a button, that is inside a dialog but not inside a form, respond to Enter key being pressed
body: <p>I need that a button inside a dialog responds to the <code>key.enter</code> event.</p>
  <p>I have searched and all the examples are buttons that are inside a <code>&lt;form&gt;</code> which is not the case</p>
  <p>Do I need to put the button inside a &quot;dummy form&quot; for this to work? can I do that without losing the current button style</p>
  <p>This is what I have tried...</p>
  <pre class="lang-html prettyprint-override"><code>&lt;mat-dialog-actions class=&quot;buttons&quot;&gt;
      &lt;button mat-button mat-dialog-close (click)=&quot;onCancelClick()&quot;&gt;
          {{data.cancel}}
      &lt;/button&gt;
      &lt;button class=&quot;action nonDefault&quot; mat-button mat-dialog-close color=&quot;accent&quot; class=&quot;action&quot;
          (click)=&quot;cancelOrClose()&quot; (keyup.enter)=&quot;cancelOrClose()&quot;&gt;
          {{data.cancelOrClose}}
      &lt;/button&gt;
  &lt;/mat-dialog-actions&gt;
  </code></pre>
  <p>Hitting enter with the dialog open does nothing</p>
  <p>similar questions that I have found</p>
  <p><a href="https://stackoverflow.com/questions/50129245/angular-5-button-submit-on-enter-key-press">Angular 5 Button Submit On Enter Key Press</a></p>
  <p><a href="https://stackoverflow.com/questions/48613131/angular-2-material-keyup-enter-does-not-fire-at-all">angular 2 material keyup.enter does not fire at all</a></p>