【发布时间】:2018-03-04 08:22:04
【问题描述】:
我一直在用 Coffeescript 和 Jade 试用 Meteor。对于最基本的应用程序,我编写了以下代码。
主咖啡
import './hello.coffee'
import './main.jade'
main.jade
head
title Chatter
body
h1 Welcome to Chatter!
+hello
你好,咖啡
import { Template } from 'meteor/templating'
import { ReactiveVar } from 'meteor/reactive-var'
import './hello.jade'
Template.hello.onCreated
helloOnCreated: ->
@counter = new ReactiveVar 0
return
Template.hello.helpers
counter: -> Template.instance().counter.get()
Template.hello.events
'click button': (event, instance) ->
instance.counter.set instance.counter.get() + 1
return
你好.jade
template(name="hello")
button Click me!
p You have pressed the button #{counter} times.
现在,当我尝试运行此应用程序时,我收到此错误Uncaught TypeError: callbacks[i].call is not a function。我对此很陌生,因此将不胜感激任何帮助。谢谢!
【问题讨论】:
标签: node.js meteor coffeescript pug