projects
/
examples
/
angular-tour-of-heroes
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
4: Add Services
[examples/angular-tour-of-heroes]
/
src
/
app
/
hero.service.ts
1
import { Injectable } from '@angular/core';
2
import { Hero } from './hero';
3
import { HEROES } from './mock-heroes';
4
5
6
@Injectable({
7
providedIn: 'root'
8
})
9
export class HeroService {
10
11
constructor() { }
12
13
getHeroes() : Hero[] {
14
return HEROES;
15
}
16
}