0

valueBinding で ember ラジオ ボタンに値を設定した後、Ember.run.end() を呼び出して、変更された値を DOM に反映します。

しかし、以下のエラーを参照してください。Error: Uncaught TypeError: Cannot call method 'prev' of null wt's this issue

  //Doing value binding here
    App.radioController.set('content', App.createRadioModel.create({ id:1 }));
    Ember.run.end();
  //Doing some css changes as soon as the value is updated onto the radio button.
  Ember.$(".view-radio").removeClass("modified","delete");
4

1 に答える 1

1

Ember.run.end()対応する なしで呼び出すべきではありませんEmber.run.start()。表示されているエラーは、おそらく現在の実行ループがないためです。

バインドを手動で同期する場合は、Ember.run.sync(). Ember.run()それ以外の場合は、次のような呼び出しでコードをラップすることをお勧めします。

Ember.run(function() {
  // your code here
});
于 2012-06-02T23:30:03.787 に答える