angular-visjs icon indicating copy to clipboard operation
angular-visjs copied to clipboard

timeline directive: options and data watch behavior

Open matt-dejavu opened this issue 10 years ago • 2 comments

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.

matt-dejavu avatar Oct 13 '14 18:10 matt-dejavu

I think the first question is: what is the reasoning behind clearing the options when the data changes?

matt-dejavu avatar Oct 13 '14 18:10 matt-dejavu

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.

josdejong avatar Oct 16 '14 12:10 josdejong