【发布时间】:2015-07-31 00:59:54
【问题描述】:
我正在研究 Meteor in action 这本书,书中作者使用 html/js,但我更喜欢玉/咖啡。这段代码我遇到了一些麻烦:
<template name="templateElseBlock">
<h3>templateElseBlock template</h3>
{{#isFemale gender}} Mrs. {{else}} Mr. {{/isFemale}}
</template>
<template name="isFemale">
{{#if eq this 'w'}}
{{> Template.contentBlock}}
{{else}}
{{> Template.elseBlock}}
{{/if}}
</template>
我尝试过这样的事情,但只有错误
While building the application:
client/main.jade: Jade syntax error: unexpected token "indent"
<runJavaScript-57>:73:14: Cannot read property 'head' of undefined
(compiling client/main.jade) (at fileModeHandler)
template(name='templateElseBlock')
isFemale gender
| Mrs.
else
| Mr.
template(name="isFemale")
if eq #{this} 'w'
+Template.contentBlock
else
+Template.elseBlock
有人知道该怎么做吗?
【问题讨论】:
-
请说明您有哪些错误
-
我在上面写了我得到的整个错误