Skip to content

smartin85/ionic-context-menu

Repository files navigation

ionic-context-menu

MIT License npm version npm downloads Known Vulnerabilities

Buy me a coffee

A set of Angular-Components for context menus in Ionic V4 Apps.

Installation

  1. Install package from npm:

npm install --save ionic-context-menu

  1. Include IonicContextMenuModule into your application:
import { NgModule } from '@angular/core';
//...
import { IonicContextMenuModule } from 'ionic-context-menu';


@NgModule({
  // ...
  imports: [
    IonicContextMenuModule
  ],
  // ...
})
export class HomePageModule {}

Example

<ion-header>
  <ion-toolbar>
    <ion-title>
      Ionic Blank
    </ion-title>
    <ion-buttons slot="end">
      <ionic-context-menu icon="ellipsis-vertical-sharp">
        <ionic-context-menu-item icon="home" (click)="action(1)">Item A</ionic-context-menu-item>
        <ionic-context-menu-item icon="star" (click)="action(2)">Item B</ionic-context-menu-item>
        <ionic-context-menu-item icon="cube" (click)="action(3)">Item C</ionic-context-menu-item>
        <ionic-context-menu-item icon="beer" (click)="action(4)">Item D</ionic-context-menu-item>
      </ionic-context-menu>
    </ion-buttons>
  </ion-toolbar>
</ion-header>

<ion-content padding>
  
</ion-content>