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

:each blah in collection = fail #52

Open
kirkbushell opened this issue Nov 30, 2011 · 2 comments
Open

:each blah in collection = fail #52

kirkbushell opened this issue Nov 30, 2011 · 2 comments

Comments

@kirkbushell
Copy link

I am currently using haml.js on the client side, as the templating solution for sammy - and a core aspect of it simply isn't working.

When I do :each var in collection, and then try and use var, it always comes up undefined. Always.

@ilich
Copy link

ilich commented Dec 5, 2011

I think the issue might be related to a couple of fixes I had done. They are not in the master branch yet.

You can try it - https://github.com/ilich/haml-js

I also did a test. It seems to be OK.

HAML markup:

%html
%body
:each value in collection
%div&= value

JavaScript:

var fs = require("fs"),
Haml = require("./haml-js/lib/haml.js"),
collection = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

var content = fs.readFileSync("./test.haml", "UTF-8");
var html = Haml.render(content, { locals: {
collection: collection
}});

console.log(html);

Please, attach you HAML markup in case you still have the issue.

@kirkbushell
Copy link
Author

Good to know this has been fixed - unfortunately a tad too late for us to use it in the project (which is a real shame :(). Keep up the good work mate, hopefully we can use it in our next js project :)

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

2 participants