Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, Input } from '@angular/core';
- @Component({
- moduleId: module.id,
- selector: 'cc-context-menu',
- template: `
- <div class="{{menuclass}}" (mouseleave)='setVisibility($event, false)' (click)='setVisibility($event, true)' [ngClass]="{'show': showMenu}">
- <ul>
- <li *ngFor="let option of options">
- <a (click)="option.action()" [innerHTML]="option.html"></a>
- </li>
- </ul>
- </div>
- `
- })
- export class ContextMenuComponent {
- showMenu: boolean = false;
- @Input() menuclass: string;
- @Input() options: any[];
- setVisibility(e: Event, show: boolean) {
- this.showMenu = show;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement