HTML markup (pseudo code):
ng-repeat assumption in assumptions
div webix-ui view=“chart” webix-data=“assumption.chartdata” type=“bar” value="#value#" borderless=“true”>
where assumptions is provided by a service and put on the controller’s scope and chartdata is a JSON object.
This generates an error orginitating in the webix-data directive $watchCollection → webix.DataLoader → _onLoad → return this._onLoadError(text, xml, loader);
Uncaught TypeError: Cannot call method ‘indexOf’ of undefined webix_debug.js:2221
(anonymous function) webix_debug.js:2221
webix.EventSystem.callEvent webix_debug.js:516
webix.AtomDataLoader._onLoadError webix_debug.js:1844
webix.DataLoader.webix.proto._onLoad webix_debug.js:7562
webix.AtomDataLoader.parse webix_debug.js:1828
(anonymous function)
if now I put the chartdata in an array on the controller’s scope:
$scope.chartdata = [];
assumptions.each(function(a) {$scope.chartdata.push(a.chardata)})
and change the html markup to
div webix-ui view=“chart” webix-data=“chartdata[$index]” type=“bar” value="#value#" borderless=“true”>
It works fine.
Note, that in the service provider, I make sure to use a dummy chartdata object while building it and then cloned it to the object which was being watched…otherwise I would get $digest.error maximum iterations exceeded…
Problem confirmed, I will provide the fixed build later today.
In above case the inner-error occurs during data loading, and to make things worse debugging system throws one more error while attempting to log details of the first error.
I need to create stacked area charts in an ng-repeat loop. Putting all the info in the markup isn’t working, nor is the preferred method of initing from a config object:
Also, update adds config sub-tag, which can be used to define complex properties, and it can be used with ng-repeat as well. You can check working sample in samples/33_angular/07_ng_repeat.html
The current usage of ng-repeat works as one-time binding. If you change values in charts or series collections - webix views will not be updated.
Unfortunately it seems that angularJS doesn’t provide any event when ng-repeat removes element from collection, so it is not possible to reconfigure widget automatically, each time when collection changes.