Angular performance: change detection detached if component is out of viewport
问题 I want detach the change detection for all the compontents out of the current viewport see demo online import { Component, Input, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef, ViewChild, OnInit, OnDestroy, AfterViewInit } from '@angular/core'; @Component({ selector: 'hello', template: `<div #counter>[{{index}}] {{count}}</div>`, styles: [`div { border: 1px solid red; padding: 5px 5px 5px 5px; }`], changeDetection: ChangeDetectionStrategy.OnPush, }) export class HelloComponent