title: Angular 2 keyup.enter for div tag
body: <p>I need to trigger one function from selected div enter key is pressed. I wrote the following code but it's not working.</p>
  
  <pre><code>&lt;div class="data_card" *ngIf="!Add.showEdit" (keyup.enter)="myfunction($event)"&gt;
  &lt;!-- Some content -- &gt;
  &lt;/div&gt;
  
  
  myfunction($event){
        $event.preventDefault();
        alert("sadsa");
  }
  </code></pre>
  
  <p>How to trigger this function from div enter key is pressed?</p>