Created
May 19, 2012 10:33
-
-
Save sammyt/2730406 to your computer and use it in GitHub Desktop.
Trying to improve the api
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
var cup = new Cup(data) | |
var map = cup.map | |
map(".first-name").to("firstName") | |
map(".last-name").to("lastName") | |
map("ul.friends") | |
.each("friends") | |
.to("li.friend", function(map) { | |
map(".friend-name").to("name") | |
map(".friend-type").to("type") | |
}) | |
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 class="person"> | |
<span class="first-name"></span> | |
<span class="last-name"></span> | |
<a>blog</a> | |
<ul class="friends"> | |
<li class="friend"> | |
<strong><span class="friend-name"></span></strong> | |
<span class="friend-type"></span> | |
</li> | |
</ul> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment