From cb719aff34e6c59b0498d79ca99d88ba3006be82 Mon Sep 17 00:00:00 2001 From: Matt Lewis Date: Sat, 20 Jul 2019 18:10:11 +0100 Subject: [PATCH] fix(week-view): expose the week column to custom event template Closes #1039 --- .../week/calendar-week-view-event.component.ts | 12 ++++++++++-- .../src/modules/week/calendar-week-view.component.ts | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/angular-calendar/src/modules/week/calendar-week-view-event.component.ts b/projects/angular-calendar/src/modules/week/calendar-week-view-event.component.ts index f8b8e24f2..bbcdb571c 100644 --- a/projects/angular-calendar/src/modules/week/calendar-week-view-event.component.ts +++ b/projects/angular-calendar/src/modules/week/calendar-week-view-event.component.ts @@ -5,7 +5,11 @@ import { EventEmitter, TemplateRef } from '@angular/core'; -import { WeekViewAllDayEvent, DayViewEvent } from 'calendar-utils'; +import { + WeekViewAllDayEvent, + DayViewEvent, + WeekViewHourColumn +} from 'calendar-utils'; import { PlacementArray } from 'positioning'; @Component({ @@ -20,6 +24,7 @@ import { PlacementArray } from 'positioning'; let-tooltipAppendToBody="tooltipAppendToBody" let-tooltipDisabled="tooltipDisabled" let-tooltipDelay="tooltipDelay" + let-column="column" >
@@ -88,5 +94,7 @@ export class CalendarWeekViewEventComponent { @Input() tooltipTemplate: TemplateRef; + @Input() column: WeekViewHourColumn; + @Output() eventClicked: EventEmitter = new EventEmitter(); } diff --git a/projects/angular-calendar/src/modules/week/calendar-week-view.component.ts b/projects/angular-calendar/src/modules/week/calendar-week-view.component.ts index 08bffa13c..ce6cd83ec 100644 --- a/projects/angular-calendar/src/modules/week/calendar-week-view.component.ts +++ b/projects/angular-calendar/src/modules/week/calendar-week-view.component.ts @@ -299,6 +299,7 @@ export interface CalendarWeekViewBeforeRenderEvent extends WeekView { [customTemplate]="eventTemplate" [eventTitleTemplate]="eventTitleTemplate" [eventActionsTemplate]="eventActionsTemplate" + [column]="column" (eventClicked)="eventClicked.emit({ event: timeEvent.event })" >