问题是我想在继续我的程序之前确保数据可用,所以我需要使用异步类型函数。 Promise似乎是ion.io的标准方法。
我有一个非常简单的……
如果你想要,你必须使用lambda函数 this 要在您在函数体内使用它时定义的关键字。
this
代替 window.setTimeout( function() { 使用 window.setTimeout(() => {
window.setTimeout( function() {
window.setTimeout(() => {
做同样的事情 p1.then 线。
p1.then
另外,在这一行: Trello.post('/cards/', this.newCard, this.creationSuccess); 而不是通过 this.creationSuccess 尝试传球 this.creationSuccess.bind(this)
Trello.post('/cards/', this.newCard, this.creationSuccess);
this.creationSuccess
this.creationSuccess.bind(this)