我在我的应用程序中使用了角度日历程序包,并用它来显示其他人在组中发布的任务和事件。我从后端获取任务和事件帖子,然后在日历中显示它们。我想知道是否可以向这些事件添加链接?我想让用户单击项目时进入实际的任务路线。
我单击了日期,然后出现一个列表,当我单击列表中的项目时,我想转到显示实际任务的路线
我已经添加了指向事件对象的链接,但是现在我不知道如何将该属性添加到模板中的事件中
模板
<div class="container">
<br />
<div class="row text-center">
<div class="col-md-4">
<div class="btn-group">
<div
class="btn btn-primary"
mwlCalendarPreviousView
[view]="view"
[(viewDate)]="viewDate"
(viewDateChange)="changeDate($event, 'previous')">
Previous
</div>
<div
class="btn btn-outline-secondary"
mwlCalendarToday
[(viewDate)]="viewDate"
(viewDateChange)="activeDayIsOpen = false">
Today
</div>
<div
class="btn btn-primary"
mwlCalendarNextView
[view]="view"
[(viewDate)]="viewDate"
(viewDateChange)="changeDate($event, 'next')">
Next
</div>
</div>
</div>
<div class="col-md-4">
<h3><b>{{ viewDate | calendarDate:(view + 'ViewTitle'):'en' }}</b></h3>
</div>
<div class="col-md-4">
<div class="btn-group">
<div
class="btn btn-primary"
(click)="view = 'month'"
[class.active]="view === 'month'">
Month
</div>
<div
class="btn btn-primary"
(click)="view = 'week'"
[class.active]="view === 'week'">
Week
</div>
<div
class="btn btn-primary"
(click)="view = 'day'"
[class.active]="view === 'day'">
Day
</div>
</div>
</div>
</div>
<br>
<div [ngSwitch]="view">
<mwl-calendar-month-view
*ngSwitchCase="'month'"
[viewDate]="viewDate"
[events]="events"
[refresh]="refresh"
[activeDayIsOpen]="activeDayIsOpen"
(dayClicked)="dayClicked($event.day)">
</mwl-calendar-month-view>
<mwl-calendar-week-view
*ngSwitchCase="'week'"
[viewDate]="viewDate"
[events]="events"
[refresh]="refresh">
</mwl-calendar-week-view>
<mwl-calendar-day-view
*ngSwitchCase="'day'"
[viewDate]="viewDate"
[events]="events"
[refresh]="refresh">
</mwl-calendar-day-view>
</div>
</div>
答案 0 :(得分:0)
看来我错过了我的同事添加的这个(eventClicked)。我可以在该方法中简单地添加一个路由器功能。