1. In Angular 2, the return result of the callback function will not automatically update the display of the view layer. You can use ChangeDetectorRef to drive the Angular to update the view.
// 导入
import {
Component, OnInit, Input, ChangeDetectorRef } from '@angular/core';
// 注入
constructor(
private changeDetector: ChangeDetectorRef
) {
}
this.showRefresh = true;
// 数据绑定变更的时候用ChangeDetectorRef驱动angular更新视图
this.changeDetector.markForCheck();
this.changeDetector.detectChanges();