Don't wrap callback functions which need to return value to fullcalendar...#123
Don't wrap callback functions which need to return value to fullcalendar...#123adieu wants to merge 1 commit intoangular-ui:masterfrom
Conversation
|
Ran into this exact issue with the eventClick option. |
|
Actually, I wouldn't mind if eventRender would also not be wrapped in the "wrapFunctionWithScopeApply". |
|
hey @adieu I see your issue, but the only thing I don't like about this, is we are hardcoding the function values into the calendar. I don't feel like crawling through the entire fullcalendar api either, so I think a solution like the one in this Plunker would work better. http://plnkr.co/edit/gdQtxBLH0LJaHc7Yam9X?p=preview We are setting the ignore array on the uiCalendarConfig, so the user can specify which functions to not wrap in a safe $timeout. What do you think about this solution? Also another solution, is to rip out the wrap all together. I think developers should know to wrap their functions in $apply anyways. |
|
I think #213 will fix this. |
According to http://arshaw.com/fullcalendar/docs1/mouse/eventClick/ and http://arshaw.com/fullcalendar/docs1/event_data/eventDataTransform/ , after fullcalendar calls
eventClickandeventDataTransform, it will then consume the return value.If we wrap those two callbacks with
wrapFunctionWithScopeApply, the wrapper function calls the wrapped function with$timeoutand never pass the return value back to fullcalendar.This breaks the design of these callbacks.
To fix this issue, the patch just avoid to wrap
eventClickandeventDataTransform. I just did a quick scan of the documents and only find these two. There might be more callbacks to ignore.This PR fixed #122