Ember.run.bind 不工作

Ember.run.bind is not working

我正在尝试让 ember.run.bind 工作,但它似乎不起作用,知道吗?我已经尝试了所有组合

_didInsertElement: Ember.on('didInsertElement', function () {
    Ember.run.bind(this, this.doSomething);
  })

_didInsertElement: Ember.on('didInsertElement', function () {
    Ember.run.bind(this, function() {
      this.doSomething();
    });
  })

_didInsertElement: Ember.on('didInsertElement', function () {
    var _this = this;
    Ember.run.bind(this, function() {
      _this.doSomething();
    });
  })

Ember.run.bind() returns 然后可以调用的函数。它用于某些异步执行,因此它不希望立即调用,在立即调用它的情况下,您不太可能需要使用 bind。

var func = Ember.run.bind(this, this.doSomething);

func();

http://emberjs.jsbin.com/diqelezika/edit?html,js,output