我正在嘗試在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 ];
}