Open kirkbushell opened 12 years ago
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.
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 :)
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.