Angular2 fullcalendar重新获取事件

时间:2017-06-29 08:19:36

标签: jquery angular fullcalendar fullcalendar-2

我正在使用angular2和angular2-fullcalendar。在我的项目中,我从后端获取数据。现在我的问题是,当我使用选择日期添加事件时,我希望它在日历上显示成功提交数据而不重新加载页面。之前我正在使用and t1.id > t2.id 为了完成工作。但我不想在角度项目中使用jquery。除了使用jquery之外,还有其他任何替代方法。请帮助。

1 个答案:

答案 0 :(得分:0)

是的,ViewChild以及ElementRef

@import { ViewChild, ElementRef } from '@angular/core';

@ViewChild('calendar') myCalendar: ElementRef;
myHtmlElement: HTMLElement;

ngOnInit() {
    this.myHtmlElement = this.myCalendar.nativeElement;
}

在您的HTML中:

<!-- Where you actual calendar is, add #calendar to your tag -->
<div id="myCalendar" #calendar></div>
相关问题