import { Injectable } from '@angular/core' ; import { Resolve , ActivatedRouteSnapshot } from '@angular/router' ; import { GroupsUtilsService } from "../../services/groups/groups-utils.service" ; @ Injectable ( ) export class MembersResolve implements Resolve < any > { constructor ( private groupUtils ) { } resolve ( route ) { let group = this . groupUtils . getGroup ( route . paramMap . get ( 'id' ) ) ; let members = this . groupUtils . getGroupMembers ( group ) ; return { group : group , members : members } ; } }