【问题标题】:Calling `this` in angular-meteor在 angular-meteor 中调用 `this`
【发布时间】:2017-10-13 06:54:12
【问题描述】:

我注意到,如果我从 Controller 调用函数,console.log(this.object) 将返回 undefined,但如果我使用 UI 中的按钮调用它,它将返回对象。 当检查this 时,this.object invoke property getter 这可能是我使用按钮调用我的函数时发生的情况。 为什么会发生这种情况?如何从 Controller 中访问 this.object

【问题讨论】:

    标签: angular-meteor


    【解决方案1】:

    请注意,这可能不是最佳解决方案,但通过调用 this.autorun 中的集合来获取 object 可以解决问题

    【讨论】:

      猜你喜欢
      • 2012-07-31
      • 1970-01-01
      • 1970-01-01
      • 2016-12-10
      • 2015-09-14
      • 2016-03-08
      • 1970-01-01
      • 2015-12-17
      • 2016-03-24
      相关资源
      最近更新 更多