Files
angular/aio/content/examples/hierarchical-dependency-injection/src/app/villains.service.ts
2018-03-19 21:51:51 -07:00

18 lines
330 B
TypeScript

import { Injectable } from '@angular/core';
import { of } from 'rxjs';
export interface Villain { id: number; name: string; }
@Injectable()
export class VillainsService {
villains: Villain[] = [
{ id: 1, name: 'Dr. Evil'},
{ id: 2, name: 'Moriarty'}
];
getVillains() {
return of(this.villains);
}
}