Hi Guys,
I've just discovered the SDK and am exploring developing 10 foot interfaces for our teams.
I'm using an adapted query example and I have found all results are a duplication of the last result.
This is caused by the generated javascript code within V1Meta.prototype.query.
The problem is highlighted below:
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
assetxml = _ref[_i];
...
_results.push(_this.get_asset_class(found_type, function(err, Cls) {
...
asset = _this.build_asset(Cls, assetxml);
return options.success(asset);
}));
}
Inside the _this.get_asset_class() callback, the variable assetxml will always reference the value of _i on the last iteration as the scope of _i is to the function.
I'm not familiar with coffee script, so I cannot help you with the V1Meta.coffee source, but hopefully what I've pointed you towards will help.
Hi Guys,
I've just discovered the SDK and am exploring developing 10 foot interfaces for our teams.
I'm using an adapted query example and I have found all results are a duplication of the last result.
This is caused by the generated javascript code within V1Meta.prototype.query.
The problem is highlighted below:
Inside the
_this.get_asset_class()callback, the variableassetxmlwill always reference the value of_ion the last iteration as the scope of_iis to the function.I'm not familiar with coffee script, so I cannot help you with the V1Meta.coffee source, but hopefully what I've pointed you towards will help.