import {Component,
OnInit,
ChangeDetectorRef,
ChangeDetectionStrategy
} from '@angular/core';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class HomePage implements OnInit {
constructor(private cdf: ChangeDetectorRef) {}
// 数据改变的地方
getRealData(message: string) {
this.cdf.markForCheck();
this.cdf.detectChanges();
}
}