18 lines
463 B
TypeScript
18 lines
463 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Resolve, Router } from '@angular/router';
|
|
import { Observable } from 'rxjs/internal/Observable';
|
|
|
|
import { Role } from './role';
|
|
import { RoleService } from './role.service';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class RoleListResolver implements Resolve<Role[]> {
|
|
constructor(private ser: RoleService, private router: Router) {}
|
|
|
|
resolve(): Observable<Role[]> {
|
|
return this.ser.list();
|
|
}
|
|
}
|