import { Component } from '@angular/core' ; import { NgStyle } from '@angular/common' ; import { ZilliqaService } from './zilliqa.service' ; import { NetworkService } from './network.service' ; @ Component ( { selector : 'app-root' , templateUrl : './app.component.html' , styleUrls : [ './app.component.css' ] } ) export class AppComponent { data : any ; constructor ( public zilliqaService , public networkService ) { this . data = { latestTxBlock : '' , networkId : '' } ; } ngOnInit ( ) { this . loadNavData ( ) ; setInterval ( ( ) => { this . loadNavData ( ) ; } , 15000 ) ; this . networkService . checkConnection ( ) ; } loadNavData ( ) { let that = this ; this . zilliqaService . getInitData ( ) . then ( function ( data ) { that . data = data ; } ) ; } }