-
-
Save elikem/02a0810c856f8b7e612c6a00916dc9a3 to your computer and use it in GitHub Desktop.
Output JSON into markup with Sightly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use(function () { | |
| var myObj = { | |
| foo: "bar", | |
| arr: [1,2,3,4,5,6,7,8,9,10] | |
| }; | |
| return { | |
| json: JSON.stringify(myObj) | |
| }; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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