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.
17 lines
570 B
TypeScript
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();
|
|
}
|
|
}
|