Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Created May 7, 2021 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetanelBasal/23a79fecb11d115fc11defb2368fac0e to your computer and use it in GitHub Desktop.
Save NetanelBasal/23a79fecb11d115fc11defb2368fac0e to your computer and use it in GitHub Desktop.
import { TippyModule } from '@ngneat/helipopper';
import { SvgIconsModule } from '@ngneat/svg-icon';
@Component({
template: `
<svg-icon key="chevron" [tippy]="menu" (visible)="onVisible($event)"></svg-icon>
<ng-template #menu>
... render the actions
</ng-template>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ResourceActionsComponent {
@Input() actions: Action[];
@Input() isGridContext = false;
onVisible($event) {
if(this.isGridContext) { ... }
}
}
@NgModule({
declarations: [ResourceActionsComponent],
imports: [CommonModule, TippyModule, SvgIconsModule],
exports: [ResourceActionsComponent],
})
export class ResourceActionsModule {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment