barker/bookie/src/app/roles/role-list-resolver.service.ts
tanshu d677cfb1ea Blacked and isorted the python files
Prettied and eslinted the typescript/html files
2020-10-11 10:56:29 +05:30

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();
}
}