2015-04-12 78 views
2

错误我在客户端的代码MeteorJS:在Meteor.call

Template['product'].events 
    'click .addcart': (event, template) -> 
    event.preventDefault() 
    add_this = {"item": 1, "name": "test", "qty": 5, "price": 124} 
    Meteor.call "Carts.push", add_this 
    return 

和服务器

Meteor.methods 
    'Carts.push': (params) -> 
    console.log params 

每次E单击按钮添加购物车我在服务器端错误

Exception while invoking method 'Carts.push' Error: Did not check() all arguments during call to 'Carts.push'

任何想法为什么这个错误仍然存​​在?

回答

1

您安装了audit-argument-checks软件包,它用于验证您传递给方法的所有参数是否被check编辑。 ing表示证明函数的一个参数是正确的类型。

meteor remove audit-argument-checks 

或者check()你的论点一样shown in the docs:你可以只是将其删除。