Answer the question
In order to leave comments, you need to log in
How to make Jade and Spacebars (Handlebars) friends?
Greetings!
I can’t figure out how to fix the code so that everyone likes everything and compiles properly :)
Here is the code:
template(name="postsList")
.posts.
{{#each posts}}
{{> postItem}}
{{/each}}
While building the application:
client/views/posts/posts_list.jade: Jade syntax error: Expected {{else}} or block close for each
{{#each posts}}
template(name="postsList")
.posts {{#each posts}} {{> postItem}} {{/each}}
Answer the question
In order to leave comments, you need to log in
Answer to the question :
template(name="postsList")
.posts
each posts
+postItem
Recently encountered a similar problem (Jade + Ractive).
He doesn't like each, he thinks it's Evonian, Jade each.
You can fix it the way you did, or like this:
template(name="postsList")
.posts
| {{#each posts}}
| {{> postItem}}
| {{/each}}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question