import { Injectable } from "@angular/core";
import { Resolve } from "@angular/router";
import { HttpClient, HttpHeaders } from "@angular/common/http";
import { Candidate } from "../models/candidate";
import { candidatListService } from "src/app/pages/candidat/candidat-list/candidat-list.service";
import { Observable } from "rxjs";

@Injectable()
export class CandidatsResolver implements Resolve<Candidate[]> {
  constructor(public service: candidatListService) {}
  resolve(): Observable<Candidate[]> {
    return this.service.getCandidats();
  }
}
