Skip to content

Instantly share code, notes, and snippets.

@elikem
Forked from gabrielwalt/logic.js
Created April 30, 2016 23:07
Show Gist options
  • Select an option

  • Save elikem/02a0810c856f8b7e612c6a00916dc9a3 to your computer and use it in GitHub Desktop.

Select an option

Save elikem/02a0810c856f8b7e612c6a00916dc9a3 to your computer and use it in GitHub Desktop.
Output JSON into markup with Sightly
use(function () {
var myObj = {
foo: "bar",
arr: [1,2,3,4,5,6,7,8,9,10]
};
return {
json: JSON.stringify(myObj)
};
});
<div data-sly-use.logic="logic.js"
data-json="${logic.json}">
...
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment