【发布时间】:2014-12-27 16:05:02
【问题描述】:
我正在尝试在我的 Angular Js 应用程序中使用 angular-ui/ui-calendar(FullCalendar)。 我有一个选择框,其中列出了一些项目,根据选择的项目,我的事件源 URL 需要更新。所以在控制器中,我确实更新了它,但是日历仍然没有使用更新的 URL,而且我需要日历来刷新/渲染,一旦源被更改。 根据这个link 需要一些删除和添加事件源。 我是 Jquery 和 Angular 的新手,所以如果有人能解释我如何在 Angular js 中做到这一点,我将不胜感激。
我在控制器的某些部分设置了 url 源,但我认为这不是正确的做法,而且它也不起作用。
$scope.locationId = 0
$scope.url = "./api/ev/event/calendarByLocationId?locationId=" + $scope.locationId;
$scope.eventSource = {
url : $scope.url
};
$scope.setURL = function(locationId) {
$scope.locationId = locationId
$scope.url = "./api/ev/event/calendarByLocationId?locationId=" + $scope.locationId;
$scope.eventSource = {
url : $scope.url
};
$scope.eventSources = [ $scope.eventSource ];
}
【问题讨论】:
标签: angularjs fullcalendar angular-ui