javascript - 在 `$scope.eventSource` 上,属性 `className` 不相加 - 问题

标签 javascript angularjs fullcalendar angular-ui

我正在为 Arshaw FullCalendar 使用 AngularJS 指令。问题是 $scope.eventSource 中的 className 没有出现在 event object 上,我的代码是:

$scope.eventSource = {
    url: "/unavailability/getCalData?userId=" + CurrentUser.user().id,// add source of working api
    className: 'performer-unavailability', // an option! -> Not Working
    currentTimezone: 'America/Chicago' // an option!
};

但是当我在事件数组中从后端发送 className 时它工作正常,className 附加到事件。我不想在后端解析一大堆数组来添加 className,请提出任何解决方案。

最佳答案

事件对象是如何在后端构建的,url是等价的吗?如果事件源缺少标题或开始标记,选项可能不起作用。

Event Objects can have "options" associated with them. However, before you can start specifying options, you must write an Event Object in its extended form. It must be a traditional JavaScript object with properties. Here are the extended forms for each type of Event Source: http://fullcalendar.io/docs/event_data/Event_Source_Object/

关于javascript - 在 `$scope.eventSource` 上,属性 `className` 不相加 - 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34492381/

相关文章:

javascript - 异步(ajax)调用后将服务/对象注入(inject) Controller

fullcalendar - 全日历营业时间

javascript - Fullcalendar 显示每天的事件数

javascript - 函数前的加号是什么?

javascript - 跟踪嵌套的 ng-repeat 索引

angularjs - 是否可以在 tfs build 上运行 karma?

javascript - Angular js 指令中的相同 "controller as"名称中断父 Controller 中的功能

php - Fullcalendar v1.6.4 从 mysql 重新获取事件

javascript - rq 值在 Node js 和 pug 中未定义

Javascript - 两个大写字母、小写字母和数字的正则表达式