import { Injectable } from '@angular/core';
import { DataService } from '../data/data.service';
import { Resolve } from '@angular/router';

@Injectable({
  providedIn: 'root',
})
export class DataResolverService implements Resolve<any> {
  constructor(private dataAccessor: DataService) {}

  resolve(): Promise<any> {
    return this.dataAccessor.loadData();
  }
}
