angular-visjs
angular-visjs copied to clipboard
timeline directive: options and data watch behavior
Issue: When the data changes, the data watch will set the options to their defaults. This also ends up setting the scope property that's bound to it. This leads to behavior in the timeline that does not match up with the options that are set (e.g. the selectable option).
Scenario: A timeline is bound to data and options properties in the markup. When the Angular controller is starting it makes an async call to a web service to retrieve data for the timeline. A callback is triggered when the web service call receives the response and sets the bound timeline data property's data to the incoming data. At this time the directive's data watch fires and, as part of its work, resets the options to their defaults.
Current workaround: set the options again in the response callback for async web service calls after the data is set.
I think the first question is: what is the reasoning behind clearing the options when the data changes?
I think the first question is: what is the reasoning behind clearing the options when the data changes?
That shouldn't be the case, the Timeline is build especially such that you can change all options on the fly.