运行angular fullcalendar控制项目,该项目在作者网站上可用。我正在从服务器获取数组中JSON形式的事件(API ref(,然后想与initialEvents(API ref(绑定。我怎样才能做到这一点?
[
{
"id": 202081,
"start": "2020-08-01",
"isWorkDay": false,
"budgetDailyNumber": 0,
"modifiedBudgetDailyNumber": 0
},
{
"id": 202082,
"start": "2020-08-02",
"isWorkDay": false,
"budgetDailyNumber": 0,
"modifiedBudgetDailyNumber": 0
}
]
这就是解决方案:
events: {
url: 'type URL here',
method: 'GET',
// extraParams: {
// custom_param1: 'something',
// custom_param2: 'somethingelse'
// },
failure: function() {
alert('there was an error while fetching events!');
},
color: 'yellow', // a non-ajax option
textColor: 'black' // a non-ajax option
}