javascript - MeteorJS : Error in Meteor. 调用

标签 javascript node.js meteor coffeescript

我在客户端有这段代码

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

每次点击按钮添加购物车时,服务器端都会出错

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

知道为什么这个错误仍然存​​在吗?

最佳答案

你有 audit-argument-checks安装包后,它用于验证您是否检查传递给方法的所有参数。 checking 意味着证明函数的参数类型正确。您可以使用以下方法将其删除:

meteor remove audit-argument-checks

或者check() 你的论点像shown in the docs .

关于javascript - MeteorJS : Error in Meteor. 调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29593305/

相关文章:

Node.js 和 ACL

javascript - 当我知道 jQuery 存在时却找不到它,这让我很困惑

javascript - 如何在组合图表(条形图和线条)中分别将 x 轴与条形图对齐?

javascript - 如何: If data attribute equals radio select add class

javascript - 基本d3 : Horizontal Bar Chart

node.js - 外键之间有一个关联

javascript - 没有nodejs的nodejs库

javascript - Meteor JS 共享方法和对象

meteor - 我可以撤销更新 Meteor 吗?

shell - Meteor JS 在客户端 html 上模拟服务器命令行