我正在尝试根据说明设置日历。日历本身显示在页面上,但不显示任何事件。
模板中的代码:
<div ui-calendar ng-model="eventSources">
我 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 时,它起作用了:
<li ng-repeat="e in eventSources">
{{e.title}} {{e.start}}
</li>
虽然日历没有显示任何内容。控制台也没有错误。你们中有人知道这里发生了什么吗?
最佳答案
仅使用一系列事件是这里的问题。 uiCalendar 只接受一个事件源数组。 http://arshaw.com/fullcalendar/docs/event_data/eventSources/
我相信我们应该让它足够灵活以允许所有的 api 源。
关于javascript - AngularJS ui-calendar——带有事件的模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17207261/