在流星

时间:2015-05-20 06:02:34

标签: javascript meteor meteor-autoform

如何实施此软件包的更新" https://github.com/yogiben/meteor-autoform-modals"

<template name="afModalTest">
    {{>autoformModals}}
    {{#afModal class="btn btn-primary" collection="Posts" operation="insert"}}
        Add a new post
    {{/afModal}}


    {{#afModal class="btn btn-primary" collection="Posts" operation="update" doc=singlePost}}
        Update post
    {{/afModal}}
</template>

Template.afModalTest.helpers({
    'singlePost':function(){
        return {
    "_id" : "e9kxyHQmfynYb9yoR",
    "title" : "Suman",
    "content" : "Software Engineer"
       }
    }
});

插入正在运行,但更新无效。

1 个答案:

答案 0 :(得分:0)

您是否尝试过singlePost._id更改文档?

{{#afModal class="btn btn-primary" collection="Posts" operation="update" doc=singlePost._id}}