2015-04-12 79 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:你可以只是將其刪除。