import { Component } from '@angular/core' ; import { Router } from '@angular/router' ; import { SpinnerService } from '../../providers/spinner.service' ; @ Component ( { templateUrl : './spinner.component.html' , selector : 'tw-spinner' , styleUrls : [ './spinner.component.scss' ] } ) export class SpinnerComponent { isLoading = false ; constructor ( private router , private spinnerService ) { spinnerService . loadingChange$ . subscribe ( ( isLoading ) => { this . isLoading = isLoading ; } ) ; } }