import { Component , Input , OnInit , NgZone , OnDestroy } from '@angular/core' ; @ Component ( { selector : 'app-hello' , templateUrl : './hello.component.html' , styles : [ `
      h1 {
        font-family: Lato;
      }
    ` , ] , } ) export class HelloComponent implements OnInit , OnDestroy { @ Input ( ) name : string ; anotherFeatureToggleData = { enableAnother : true , } ; intervalId ; ngOnInit ( ) { console . error ( 'HelloComponent - ngDoCheck() - Should not be called' , this . name ) ; } constructor ( private zone ) { this . zone . runOutsideAngular ( ( ) => { this . intervalId = setInterval ( ( ) => { this . zone . run ( ( ) => { Object . keys ( this . anotherFeatureToggleData ) . forEach ( ( key ) => ( this . anotherFeatureToggleData [ key ] = ! this . anotherFeatureToggleData [ key ] ) ) ; } ) ; } , 2000 ) ; } ) ; } ngOnDestroy ( ) { if ( this . intervalId ) { clearInterval ( this . intervalId ) ; } } }