Pio*_*ski 4 javascript fullcalendar angularjs angular-ui angularjs-directive
我正在尝试根据说明设置日历.日历本身显示在页面上,但不显示任何事件.
模板中的代码:
<div ui-calendar ng-model="eventSources">
我控制器中的代码:
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)}];
Run Code Online (Sandbox Code Playgroud)
当我在模板中循环遍历eventSource时,它可以工作:
<li ng-repeat="e in eventSources">
{{e.title}} {{e.start}}
</li>
Run Code Online (Sandbox Code Playgroud)
但是,日历没有显示任何内容.控制台也没有错误.你们当中有没有人知道这里发生了什么?
这里只使用一系列事件.uiCalendar只接受一系列eventSources.http://arshaw.com/fullcalendar/docs/event_data/eventSources/
我认为我们应该使其足够灵活,以便允许所有api源.