我正在尝试在Angular Js应用中使用angular-ui/ui-calendar(FullCalendar)。 我有选择框列出了一些项目,根据选定的项目,我的事件源URL需要更新。因此,在控制器中,我会更新它,但是日历仍然没有使用更新后的URL,并且一旦源发生更改,我还需要日历刷新/渲染。 按照这link需要一些删除和添加事件源。 我对Jquery和Angular都很陌生,所以我会很感激,如果任何人都可以解释我如何在角js中做到这一点。angular-ui/ui-calendar在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 ];
}