-
Notifications
You must be signed in to change notification settings - Fork 727
Function wrapping always returns undefined. #228
Comments
I'm not sure we should even be doing this anyways. It causes so many issues in the first place. But I was trying to debug the issue and I commented out the wrapFunction completely, so in this plunker the selectOverlap function does not fire at all. I may be doing something wrong, but it seems odd, that it does not work, even if we bypass the wrapFunction all together. |
ok I see, but for some reason the selectOverlap is still not working for me. But nevertheless, here is a proposed solution for the issue. http://plnkr.co/edit/gdQtxBLH0LJaHc7Yam9X?p=preview This solves #123 and this issue, by allowing the user to specify which functions to ignore. This is done in the plunker on line 12 of calendarController.js
What do you think about this solution? |
Any updates on this issue? I would love to be able to use selectOverlap and eventOverlap with functions, as that enables for more granular control |
As selectOverlap could receive a function from the scope, the wrapper is managing it to execute it on the next digest.
That's fine, but when fullCalendar is working with the result of that method, then it receives undefined -of course, because the wrapper is not returning anything and is calling a $promise that will be resolved on the next digest..
Because of that, a method like selectOverlap can never trust in the return of the wrapper method.
You can reproduce it in this plunker:
As you can see, I've set the property to return a simple function that always returns true.
But that function is wrapped, by wrapFunctionWithScopeApply
So It will always returns wrapper, that is a function without return, executing a promise calling $timeout, so fullcalendar always check it as undefined.
I think this explains also PR 122 wrapFunctionWithScopeApply breaks eventDataTransform
The text was updated successfully, but these errors were encountered: