* closes #3086 * samples reworked to conform to our sample style, make more sense, and cover the points in prose. * copy edits to bring closer to Google docs standards.
18 lines
361 B
TypeScript
18 lines
361 B
TypeScript
import { Injectable } from '@angular/core';
|
|
|
|
import { of } from 'rxjs/observable/of';
|
|
|
|
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);
|
|
}
|
|
}
|