Skip to content

Instantly share code, notes, and snippets.

@pure
Created June 7, 2012 14:47
Show Gist options
  • Save pure/2889190 to your computer and use it in GitHub Desktop.
Save pure/2889190 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://github.com/pure/pure/raw/master/libs/pure.js"></script>
</head>
<body>
<div id="test">
<ol>
<li>
<ul>
<li></li>
</ul>
</li>
</ol>
</div>
<script>
var data = [{
name:'a',
children:[1, 2]
},{
name:'b',
children:[3, 4]
}],
dir = {
'ol li':{
'item1<-':{
'ul li':{
'item2<-item1.children':{
//'.':'#{item1.name}: #{item2}'
'.':function(a){
return a.item1.item.name + ': ' + this;
}
}
}
}
}
};
$('#test').render(data, dir);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment