tanshu
1350870f9e
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
564 B
TypeScript
17 lines
564 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot } from '@angular/router';
|
|
import { Role } from './role';
|
|
import { Observable } from 'rxjs/internal/Observable';
|
|
import { RoleService } from './role.service';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class RoleListResolver implements Resolve<Role[]> {
|
|
constructor(private ser: RoleService, private router: Router) {}
|
|
|
|
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Role[]> {
|
|
return this.ser.list();
|
|
}
|
|
}
|