import { Component , NgZone } from '@angular/core' ; @ Component ( { selector : 'app-home' , templateUrl : './home.component.html' , styleUrls : [ './home.component.scss' ] , } ) export class HomeComponent { featureToggleData : any = { enableFirstText : false , enableSecondText : true , } ; constructor ( private zone ) { this . zone . runOutsideAngular ( ( ) => { setInterval ( ( ) => { this . zone . run ( ( ) => { Object . keys ( this . featureToggleData ) . map ( key => ( this . featureToggleData [ key ] = ! this . featureToggleData [ key ] ) ) ; } ) ; } , 5000 ) ; } ) ; } }