Skip to content

Commit

Permalink
fix(week-view): expose the week column to custom event template
Browse files Browse the repository at this point in the history
Closes #1039
  • Loading branch information
mattlewis92 committed Jul 20, 2019
1 parent 63d7629 commit cb719af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -20,6 +24,7 @@ import { PlacementArray } from 'positioning';
let-tooltipAppendToBody="tooltipAppendToBody"
let-tooltipDisabled="tooltipDisabled"
let-tooltipDelay="tooltipDelay"
let-column="column"
>
<div
class="cal-event"
Expand Down Expand Up @@ -63,7 +68,8 @@ import { PlacementArray } from 'positioning';
tooltipTemplate: tooltipTemplate,
tooltipAppendToBody: tooltipAppendToBody,
tooltipDisabled: tooltipDisabled,
tooltipDelay: tooltipDelay
tooltipDelay: tooltipDelay,
column: column
}"
>
</ng-template>
Expand All @@ -88,5 +94,7 @@ export class CalendarWeekViewEventComponent {

@Input() tooltipTemplate: TemplateRef<any>;

@Input() column: WeekViewHourColumn;

@Output() eventClicked: EventEmitter<any> = new EventEmitter();
}
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ export interface CalendarWeekViewBeforeRenderEvent extends WeekView {
[customTemplate]="eventTemplate"
[eventTitleTemplate]="eventTitleTemplate"
[eventActionsTemplate]="eventActionsTemplate"
[column]="column"
(eventClicked)="eventClicked.emit({ event: timeEvent.event })"
>
</mwl-calendar-week-view-event>
Expand Down

0 comments on commit cb719af

Please sign in to comment.