import { Injectable } from '@angular/core' ; import { ActivatedRouteSnapshot , Resolve } from '@angular/router' ; import { Observable } from 'rxjs' ; import { take } from 'rxjs/operators' ; import { ProjectService } from '@core/services/index.service' ; import { IProject } from '@shared/models/index.model' ; @ Injectable ( { providedIn : 'root' , } ) export class PublicProjectResolver implements Resolve < IProject [ ] > { param projectService constructor ( private projectService ) { } param route resolve ( route ) { return this . projectService . findPublicProjects ( ) . pipe ( take ( 1 ) ) ; } }