1

下面的代码是我使用 angularjs 的新应用程序的示例代码。我集成了 ui-calendar 并在其中进行了一些自定义。我试图从服务器获取数据并在 ui-calendar 中显示。数据正在使用 angularjs http 请求获取,但日历没有显示其中的任何数据。当我删除 http 请求成功调用虚拟数据正常工作时。在下面的代码 loaddata iam 在成功调用中调用时,我保留事件源以在日历中添加数据。但没有数据显示。我如何使用角度将数据放入 ui-calendar 的 http 请求。请提前谢谢,我正在使用 fullcalendar

$scope.eventSources2 = [];
if ($rootScope.checkConnection()) {
    apiFactory.getData()
        .success(function(res) {
            LoadData(res.data); // <- this is function which is calling to display data in calendar
            console.log(res);
        })
        .error(function(e){
            console.log('check error log');
            console.log(e);
        });
} else {
}
4

2 回答 2

0

当您在 html 中定义 ui-calendar 时,应该有一个 ng-model。您应该在您的 LoadData 函数中进行更新,该变量和 Angular 可以解决问题。

于 2016-04-26T09:04:24.910 回答
0

uiCalendarConfig.calendars['myCalendar3'].fullCalendar('addEventSource',$scope.calEventsExt); 这里 mycalendar3 是

希望这个答案能帮助那些也在为此苦苦挣扎的人......

于 2016-04-28T06:43:43.647 回答