Last active
May 4, 2017 07:31
-
-
Save beebole/46cf245ccf4761fbd305cd5baf4b284d to your computer and use it in GitHub Desktop.
This file contains 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
<!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://pure.github.io/pure/libs/pure.js"></script> | |
</head> | |
<body> | |
<div class="testDiv"> | |
<span class="testspan" style="color: red;" >Ranafa</span> | |
</div> | |
<script> | |
var carJson = [{city:'AAAA'},{city:'BBBB'}], | |
directive = { | |
'span.testspan':{// the node to be iterated | |
'car<-':{ //the data that will trigger the repeat | |
'.':'car.city' //assigning values or attributes, here using the '.' to assign a value to the iterated node | |
} | |
} | |
}; | |
$('.testDiv').render(carJson, directive); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment