Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Some helpful macros for aria templates.
// Log any object in the console
{macro _log(obj)}
${(function(){console.log(obj)})()}
{/macro}
// create a section with a one-liner : {call _section("mysection", "boundvalue", "div")/}
{macro _section(id, bindings, type, css)}
{var _gb = null /}
${(function(){_gb=function(b){return {inside:data,to:b}}})()}
${(function(){bindings=Array.isArray(bindings)?bindings.map(function(b){return _gb(b)}):[_gb(bindings)]})()}
${(function () {type = type ? type : "div"; return ""})()}
{section {
id : id,
type : type,
macro : id,
bindRefreshTo : bindings,
cssClass : css || undefined
}/}
{/macro}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment