2016-04-26 115 views
0

以下代码之后angularjs ui-calendar是我的新应用程序使用angularjs.I集成ui-calendar的示例代码,并在其中完成了一些定制.Iam尝试从服务器获取数据并在ui中显示-calendar.Data使用angularjs http请求获取,但日历不显示任何数据。当我删除该请求成功调用虚拟数据正常工作。在下面的代码loaddata iam调用内部成功调用,那里我保持eventsource添加在calendar.but数据没有数据displaying.how我用角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 { 
} 

回答

0

当你定义您在你的html中的ui-calendar应该有一个ng模型。 你应该在你的LoadData函数中进行更新,那个变量和Angular会做的。

+0

是的,我有这样的行 –

+0

+0

$ scope.eventSources2 = [NEWVALUE] value this eventsource2还显示何时使用{{}}在视图 –

0

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

希望这个答案将帮助那些谁也挣扎在这个...

+0