Browse Source

Support objects/arrays in script interpolations. Closes #2239

pull/2253/head
Artur Arseniev 7 years ago
parent
commit
f6596d030b
  1. 5
      src/dom_components/model/Component.js

5
src/dom_components/model/Component.js

@ -1074,7 +1074,10 @@ const Component = Backbone.Model.extend(Styleable).extend(
// If at least one match is found I have to track this change for a
// better optimization inside JS generator
this.scriptUpdated();
return this.attributes[v] || '';
const result = this.attributes[v] || '';
return isArray(result) || typeof result == 'object'
? JSON.stringify(result)
: result;
});
return scr;

Loading…
Cancel
Save