1

モデルを持つ次の BackboneJS ビューがあります。

view = Backbone.View.extend({
   events: {
       // This will fire btnClicked() when the button is clicked
       "click .btn": "btnClicked",

       // Will this fire when the "data" property of my model changes?
       "change:data": "render"
   },
   btnClicked: function() {},
   render: function() {}
});

このショートカットを使用できるかどうかはわかりませんか?

そうでない場合、拡張形式は次のようになります。

this.model.bind("change:data", render);
4

2 に答える 2