Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

howto set attribute and value at the same time to the same value? #89

framlin opened this Issue Oct 26, 2012 · 0 comments


None yet
1 participant

framlin commented Oct 26, 2012

html =
data = [{target:1},{target:2}]

Plates.bind(html, data);

what I want to have as a mapping/binding-result is:


The problem seems to be, that I did not get, how to set a tag-attribute AND the tag-valuue at the same step.
I have a played a little with map, but I only have the attribute set OR the value, but never both. Here is one other example:

var data = [{href: 'a', msg: 1}, {href: 'b', msg: 2}];
var html = '<div href="#"></div><div class="msg"></div>';
var Plates = require('plates');
var map = Plates.Map();
//var result = Plates.bind(html, data);
//<div href="#"></div><div class="msg">1</div><div href="#"></div><div class="msg">2</div>

//var result = Plates.bind(html, data, map);
//<div href="a"></div><div class="msg"></div><div href="b"></div><div class="msg"></div>

Is there any way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment