Tag: coffeescript pug

MeteorJS:如何获得input文本的价值

我有这个代码: product.jade template(name="product") label(for="qty") Qty: input#qty.form-control(type="text", value="1", name="qty") button.btn.btn-default.addcart Add to Cart product.coffee Template['product'].events 'click .addcart': (event, template) -> ???? 如何获得input文本qty的价值? 我尝试了事件variables,但它的button有限。 有任何想法吗?

使用meteor与咖啡和玉:callback .call不是一个函数

我一直在用Coffeescript和Jade尝试Meteor。 而对于最基本的应用程序,我写了下面的代码。 main.coffee import './hello.coffee' import './main.jade' main.jade head title Chatter body h1 Welcome to Chatter! +hello hello.coffee 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 […]

来自node.js的MongoDB查询(express-coffeescript-mongodb)

我是新来的数据库查询与noSQL数据库,并有一个快速的问题。 本质上,我想检索所有具有“publishedImage”设置为“true”的字段的“名称”。 我想将结果存储在一个数组中,然后使用类似于while循环的方式将无序列表中的名称打印到视图文件夹中的.jade模板文件中。 我需要做什么查询? 我知道如何用php和mysql来完成这个任务,但是在查看完节点教程之后,我开始更加困惑。 如果我可以得到一些帮助,我将非常感激! 多谢你们, 乔尔。