我正在使用有角度的ui-calendar而我正试图通过$scope.eventSources
来自我后端的物体。我已经确认该对象存在。它看起来像这样:
, "eventSources" : [
{
"title": 'All Day Test Event',
"start": new Date(2017, 0, 10)
},
{
"title": 'Long Test Event',
"start": new Date(2017, 0, 10),
"end": new Date(2017, 0, 19)
},
{
"title": 'Test Appointment',
"start": new Date(2017, 0, 10),
"end": new Date(2017, 0, 17),
"allDay": false
}
]
如果我对事件进行硬编码,我可以确认日历显示事件,如:
$scope.eventSources =
[
[
{
title: 'All Day Test Event',
start: new Date(2017, 0, 9)
},
{
title: 'Long Test Event',
start: new Date(2017, 0, 10),
end: new Date(2017, 0, 12)
},
{
title: 'Test Appointment',
start: new Date(2017, 0, 8),
end: new Date(2017, 0, 21),
allDay: false
}
]
];
当我尝试将对象传递给$scope.eventSources
时:
$scope.eventSources = [vm.myPractice[0].eventSources]
它在日历上没有显示任何内容。有人可以称重吗?
答案 0 :(得分:0)
这是我找到的解决方案。它有点hacky,但它有效
chef-server-ctl user-create jsmith John Smith jsmith@foo.com acleartextpasswordinmygitrepo