Meteor:使用浏览器事件的反应数据重新呈现模板

时间:2015-03-19 07:58:20

标签: meteor coffeescript

我定义了以下路由器和模板。但是,当调用事件处理程序时,模板不会被重新呈现。我的印象是物品光标是反应性的;事件处理程序应如何更新此变量?



MyRouter = RouteController.extend
template: 'myTemplate'
subscriptions: Meteor.subscribe 'items'
items: Items.find {}
data: ->
    items: @items()

Template.myTemplate.events
'click .someButton': (e) ->
    Template.parentData().items = Items.find({ .. })

          <!-- parent template -->  
          {{#each ../items}}
              <div class='radio'>
                <label>
                  <input type='radio' name='optionsRadios' id='{{this.id}}' value='{{this.id}}'>
                  {{this.text}}
                </label>
              </div>
            {{/each}}
&#13;
&#13;
&#13;

0 个答案:

没有答案