A set of Angular-Components for context menus in Ionic V4 Apps.
- Install package from npm:
npm install --save ionic-context-menu
- Include
IonicContextMenuModule
into your application:
import { NgModule } from '@angular/core';
//...
import { IonicContextMenuModule } from 'ionic-context-menu';
@NgModule({
// ...
imports: [
IonicContextMenuModule
],
// ...
})
export class HomePageModule {}
<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>