title: How to make disable right click function in angular called from any component
body: <pre><code>&lt;div class="container" (contextmenu)="onRightClick()"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to disable right click in a few components and not the whole website. I have to define the below function in all the components where I want to disable right click.
  What's the best way to do it so that I don't have to define the function again and again in those components</p>
  
  <pre><code>onRightClick() {
    return false;
  }
  </code></pre>