繁体   English   中英

如何在从服务器获取数据后刷新angularjs ui-calendar

[英]how to refresh angularjs ui-calendar after data fetched from server

下面的代码是我的新应用程序的示例代码使用angularjs.I集成了ui-calendar并在其中完成了一些自定义。我试图从服务器获取数据并在ui-calendar中显示。使用angularjs http请求获取数据,但日历未显示当我删除那个http请求成功调用虚拟数据正常工作时。在下面的代码loaddata iam调用成功调用里面,我保持eventsource在日历中添加数据。但是没有数据显示我是否使用angular http请求将数据放入ui-calendar.Please,提前感谢,还有一件事我正在使用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 {
}

在html中定义ui-calendar时,应该有一个ng-model。 你应该在你的LoadData函数中更新,那个变量和Angular会起作用。

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

希望这个答案能帮助那些也在努力解决这个问题的人......

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM