import { Component , Input , ViewEncapsulation } from '@angular/core' ; import { ContentActionRef } from '@alfresco/adf-extensions' ; import { AppExtensionService } from '@alfresco/aca-shared' ; @ Component ( { selector : 'app-context-menu-item' , templateUrl : './context-menu-item.component.html' , encapsulation : ViewEncapsulation . None , host : { class : 'app-context-menu-item' } } ) export class ContextMenuItemComponent { @ Input ( ) actionRef : ContentActionRef ; constructor ( private extensions ) { } runAction ( ) { if ( this . hasClickAction ( this . actionRef ) ) { this . extensions . runActionById ( this . actionRef . actions . click ) ; } } private hasClickAction ( actionRef ) { return ! ! ( actionRef && actionRef . actions && actionRef . actions . click ) ; } trackByActionId ( _ , obj ) { return obj . id ; } }