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

Partials #102

Open
me-ascii opened this issue Mar 26, 2013 · 1 comment
Open

Partials #102

me-ascii opened this issue Mar 26, 2013 · 1 comment

Comments

@me-ascii
Copy link

Have a trouble with data mapping if used partials.
It can be illustrated on expamle from your README.md

var partial = '<li class="partial"></li>';
var base = '<div><h1 class="foo"></h1><ul class="menu"></ul></div>';

var baseData = { foo: 'bar' };
var mapping = Plates.Map();

mapping.class('menu').append(partial);
console.log(Plates.bind(base, baseData, mapping));

Results is:

<div><h1 class="foo"></h1><ul class="menu"><li class="partial"></li></ul></div>

foo = 'bar' was not rendered!

@me-ascii
Copy link
Author

I found that only html of partials mapped by baseData in the .bind (not base that passed in the args).
https://github.com/flatiron/plates/blob/master/lib/plates.js#L350

So when foo moved to the partial

var partial = '<li class="partial"><p class="foo"></p></li>',

Bind returns

<div><h1 class="foo"></h1><ul class="menu">
<li class="partial"><p class="foo">bar</p></li></ul></div>

As found this issue refers to the #76

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