Socket
Book a DemoInstallSign in
Socket

@w3soto/ngx-mat-context-menu-trigger

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@w3soto/ngx-mat-context-menu-trigger

Context menu trigger for Angular Material

1.0.9
latest
npmnpm
Version published
Weekly downloads
9
200%
Maintainers
1
Weekly downloads
 
Created
Source

NgxMatContextMenuTrigger

Context menu trigger for Angular Material

w3soto

StackBlitz Demo

Screenshot

Installation

npm -i @w3soto/ngx-mat-context-menu-trigger

Example

For more details see projects/demo application

import { NgxMatContextMenuTriggerModule } from "ngx-mat-context-menu-trigger";
...

@NgModule({
  imports: [
    ...,
    NgxMatContextMenuTriggerModule,
  ],
  ...
})
class AppModule { ... }

Disable native context menu

document.body.addEventListener('contextmenu', (e: Event) => e.preventDefault());

Template

  <div
    class="context-menu-div"
    [ngxMatContextMenuTriggerFor]="myMenu"
    [ngxMatContextMenuTriggerData]="{title: 'My Menu Title'}">
      
    Context menu
    
  </div>

  <mat-menu #myMenu>
    <ng-template matMenuContent let-title="title">
      <h4>{{ title }}</h4>
      <button mat-menu-item>Menu item 1</button>
      <button mat-menu-item>Menu item 2</button>
      <button mat-menu-item>Menu item 3</button>
    </ng-template>
  </mat-menu>

Directives

  • ngxMatContextMenuTriggerFor
@InputTypeDefaultDescription
ngxMatContextMenuTriggerForMatMenuMatMenu component (required!)
ngxMatContextMenuTriggerDisabledbooleanfalse
ngxMatContextMenuTriggerDataany
ngxMatContextMenuTriggerRestoreFocusbooleantrue
@OutputTypeDescription
menuOpenedvoidEmitted when menu is opened
menuClosedvoidEmitted when menu is closed

Exported as ngxMatContextMenuTrigger

Keywords

angular

FAQs

Package last updated on 14 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.