Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping the same partial multiple times with collections example #126

Open
JMoli opened this issue Jan 7, 2015 · 0 comments
Open

Mapping the same partial multiple times with collections example #126

JMoli opened this issue Jan 7, 2015 · 0 comments

Comments

@JMoli
Copy link

JMoli commented Jan 7, 2015

Just started playing with Plates. Struggled with getting multiple partials to work nicely. Here is an example of how I got it to work:

var partial = '<li class="partial"></li>';
var base = '<div><h1 class="foo"></h1><ul class="menu"></ul></div>';
var collection = [{'partial':'test1'},{'partial':'test2'},{'partial':'test3'}];
var multiPartial = Plates.bind(partial, collection);
var mapping = Plates.Map();
mapping.class('menu').append(multiPartial);
var baseData = { foo: 'bar' };
console.log(Plates.bind(base, baseData, mapping));
@JMoli JMoli changed the title Mapping the same partial multiple times proves difficult Mapping the same partial multiple times with collections example Jan 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant