title: Hide Primeng context menu with a condition
body: <p>I'm trying to hide the context menu when there is a condition applied. I've come across <a href="https://stackoverflow.com/questions/47235291/show-context-menu-after-condition-check-in-primeng-angular-4?answertab=oldest#tab-top">this</a> post and followed through with it but still, the context menu is showing. I'm trying to add context menu to p-table and I have a condition where if there are no options available then I want to hide context menu but when I'm calling hide() method on context menu it's not working. below are the code snippets of what I did so far.</p>
  
  <p>In .html file</p>
  
  <pre><code>&lt;p-table #table (onContextMenuSelect)="onContextMenuSelect($event, tableContextMenu)" [contextMenu]="tableContextMenu"&gt; &lt;/p-table&gt;
  &lt;p-contextMenu #tableContextMenu appendTo="body" [model]="contextMenus"&gt;&lt;/p-contextMenu&gt;
  </code></pre>
  
  <p>In .ts file</p>
  
  <pre><code> public onContextMenuSelect(event, contextMenu){
       if(this.loadContextMenu){
       contextMenu.hide();
     }
  }
  </code></pre>