I’m currently reading & following along with the code in the Discover Meteor book.
I’ve just reached the Creating Posts chapter, and (I like to add my own tweaks here and there - it helps me learn) I added a Spacebars {{#if}}{{/if} block around the link to the New Post form in my header template, so it would only be visible to logged-in users (this may be something that the book will cover eventually anyway – I haven’t read ahead).
The problem is, I get an error from Meteor even though the code looks right to me and uses the right test for a logged-in user (according to the way I understood the Meteor docs, anyhow):
My code:
{{#if Meteor.userId()}}
<li><a href="{{pathFor 'postSubmit'}}">New post</a></li>
{{/if}}
The error message:
=> Errors prevented startup:
While building the application:
client/templates/includes/header.html:21: Expected space
... {{#if Meteor.userId()}} <li><...
^
=> Your application has errors. Waiting for file change.
I’m stuck here, so any help would be greatly appreciated. Thanks!