AngularJS UI日历 - 模型事件 [英] AngularJS ui-calendar – model with events
问题描述
我试图按照指示设立一个日历。日历本身显示在网页上,但它不显示任何事件。
I’m trying to set up a calendar according to the instructions. The calendar itself shows up on the page, but it doesn’t display any events.
code模板:
<格UI日历NG模型=eventSources>
code在我的控制器:
Code in my controller:
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$scope.eventSources = [
{
"title": 'All Day Event',
"start": new Date(y, m, d)},
{
"title": 'Long Event',
"start": new Date(y, m, d - 5),
"end": new Date(y, m, d - 2)}];
当我通过它的工作模板eventSources循环:
When I loop through eventSources in the template it works:
<li ng-repeat="e in eventSources">
{{e.title}} {{e.start}}
</li>
日历不显示任何东西,虽然。有控制台没有错误了。是否有你有什么是怎么回事的想法?
The calendar doesn’t show anything, though. There are no errors in console, too. Does any of you has an idea of what’s going on here?
推荐答案
使用的事件只是一个数组是这里的问题。 uiCalendar只需要eventSources的阵列。 <一href=\"http://arshaw.com/fullcalendar/docs/event_data/eventSources/\">http://arshaw.com/fullcalendar/docs/event_data/eventSources/
Using Just an array of events is the issue here. uiCalendar only takes an array of eventSources. http://arshaw.com/fullcalendar/docs/event_data/eventSources/
我认为,我们应该让它足够的灵活性,以便所有的不过API源。
I believe that we should make it flexible enough to allow for all of the api sources however.
这篇关于AngularJS UI日历 - 模型事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!