【问题标题】:How Do I Display Document ID Using Meteor Spacebars?如何使用 Meteor 空格键显示文档 ID?
【发布时间】:2013-07-28 18:20:36
【问题描述】:

我是 Meteor 的新手,我有一个应用程序可以将数据输出到表的行中,我想为 ObjectID 设置一个列仅用于测试目的,我将在生产中禁用它,但我的车把模板可以似乎根本没有输出 _id。任何想法表示赞赏! 这是我的模板:

<template name="Fillup">
   {{#each FillupArr}}
        <tr class="fillup row">
            <td> <div class="btnEdit">edit</div> <div class="btnSave" >save</div></td>
            <td class="">{{Fillup_id.toHexString}}</td>
            <td class="dateResult">{{Date}}</td>
            <td class="mpg">{{MPG}}</td>
            <td class="tripResult">{{Trip}}</td>
            <td class="ppg">{{PPG}}</td>
            <td class="ppm">{{PPM}}</td>
            <td class="galResult">{{Gal}}</td>
            <td class="priceResult">{{Price}}</td>
            <td class="stationResult">{{Station}}</td>
            <td> <div class="btnRemove">remove</div> <div class="btnCancel">cancel</div></td>
        </tr>
   {{/each}}
</template>

【问题讨论】:

    标签: mongodb meteor spacebars


    【解决方案1】:

    我想通了,你不需要在车把模板中包含集合名称,所以它从:

     <td class="">{{Fillup_id.toHexString}}</td>
    

     <td class="">{{_id}}</td>
    

    现在它可以工作了!

    【讨论】:

      猜你喜欢
      • 2016-11-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-03
      • 1970-01-01
      • 2014-12-24
      • 1970-01-01
      • 1970-01-01
      • 2019-06-13
      相关资源
      最近更新 更多