Files
brewman/overlord/src/app/user/user-list-resolver.service.ts
T
tanshu 1350870f9e Moved from tslint to eslint as tslint was depreciated.
Added prettier and also prettied all the typescript files using prettier

ESLint is using the AirBnB rules which are the most strict to lint the files.
2020-10-01 21:28:12 +05:30

17 lines
570 B
TypeScript

import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot } from '@angular/router';
import { User } from '../core/user';
import { Observable } from 'rxjs/internal/Observable';
import { UserService } from './user.service';
@Injectable({
providedIn: 'root',
})
export class UserListResolver implements Resolve<User[]> {
constructor(private ser: UserService, private router: Router) {}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<User[]> {
return this.ser.list();
}
}