Skip to content

Instantly share code, notes, and snippets.

@wilkerlucio
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save wilkerlucio/efb4bfbdfaef4b1362a7 to your computer and use it in GitHub Desktop.

Select an option

Save wilkerlucio/efb4bfbdfaef4b1362a7 to your computer and use it in GitHub Desktop.
var Template = {
compile: function(string, builder) {
var rootNode = $(string);
var map = {};
rootNode.find("[data-binding]").each(function () {
var el = $(this);
var bindingName = el.data("binding");
map[bindingName] = el;
});
builder(map);
return rootNode;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment