Angular-Promise解决下一个变更检测周期

时间:2019-01-18 14:49:31

标签: angular promise angular2-changedetection angular-changedetection

我正在调用一个返回Promise.all的函数。

applyFilterToSh = (sheet, name, value)=>{
  return sheet.applyFilterAsync(name, value, tableau.FilterUpdateType.REPLACE);
}

applyFilterToSheets = (name, value) => {
  let sheets = this.getActiveSheet().getWorksheets();
  return Promise.all(sheets.map((sheet)=>{
    return this.applyFilterToSh(sheet, name, value);
  }))
}

setDefaultFilters(){
this.applyFilterToSheets(filterValues[0].name, filterValues[0].values[0].formattedValue).then((s)=>{
        this.gFilters.setIsDashboardLoading(false);
        this.gFilters.setAllFilters(this.currentFiltersList);
      })
}

仅当我打开浏览器控制台或关闭它时,才会触发成功回调。

0 个答案:

没有答案