Skip to content

Instantly share code, notes, and snippets.

@beebole
Last active May 4, 2017 07:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beebole/46cf245ccf4761fbd305cd5baf4b284d to your computer and use it in GitHub Desktop.
Save beebole/46cf245ccf4761fbd305cd5baf4b284d 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://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