File

src/app/specialties/spec-resolver.ts

Example

Index

Methods

Constructor

constructor(specialtyService: SpecialtyService)
Parameters :
Name Type Optional
specialtyService SpecialtyService No

Methods

resolve
resolve()
Returns : Observable | Promise | []
import {Injectable} from '@angular/core';
import {Specialty} from './specialty';
import {Resolve} from '@angular/router';
import {SpecialtyService} from './specialty.service';
import {Observable} from 'rxjs';

/**
 * @author Vitaliy Fedoriv
 */

@Injectable()
export class SpecResolver implements Resolve<Specialty[]> {

  constructor(private specialtyService: SpecialtyService) { }

  resolve(): Observable<Specialty[]> | Promise<Specialty[]> | Specialty[] {
    return this.specialtyService.getSpecialties();
  }

}

result-matching ""

    No results matching ""