import 'zone.js';
// Your Angular application code here
ngAfterViewInit() {
this.dataService.getData().subscribe(data => {
this.myData = data;
this.changeDetector.detectChanges(); // Trigger manual change detection
});
}
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<div>{{ data }}</div>
`
})
export class MyComponent {
@Input() data: string;
}