import { Injectable } from '@angular/core'; import { Resolve } from '@angular/router'; import { TimeZoneService } from '@core/services/time-zone.service'; @Injectable({ providedIn: 'root' }) export class TimeZoneResolver implements Resolve { constructor ( private timeZoneService: TimeZoneService ) { } resolve () { if (!this.timeZoneService.timeZones) { this.timeZoneService.setTimeZones(); } } }