This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1
1
// #docplaster
2
2
// #docregion
3
- // #docregion empty-class
3
+ // #docregion empty-class, full
4
4
import { Injectable } from '@angular/core' ;
5
5
6
6
// #enddocregion empty-class
@@ -9,8 +9,16 @@ import { HEROES } from './mock-heroes';
9
9
// #docregion empty-class, getHeroes-stub
10
10
@Injectable ( )
11
11
export class HeroService {
12
- // #enddocregion empty-class
12
+ // #enddocregion empty-class, getHeroes-stub, full
13
+ /*
14
+ // #docregion getHeroes-stub
13
15
getHeroes(): void {
14
16
}
15
- // #docregion empty-class
17
+ // #enddocregion getHeroes-stub
18
+ */
19
+ // #docregion full
20
+ getHeroes ( ) : Hero [ ] {
21
+ return HEROES ;
22
+ }
23
+ // #docregion empty-class, getHeroes-stub
16
24
}
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ code-example(language="bash").
129
129
### Return Mocked Heroes
130
130
Back in the `HeroService` we import the mock `HEROES` and return it from the `getHeroes` method.
131
131
Our `HeroService` looks like this:
132
- + makeExample('toh-4/ts/app/hero.service.2 .ts' , null , 'app/hero.service.ts' )( format ="." )
132
+ + makeExample('toh-4/ts/app/hero.service.1 .ts' , 'full' , 'app/hero.service.ts' )( format ="." )
133
133
:marked
134
134
### Use the Hero Service
135
135
We're ready to use the `HeroService` in other components starting with our `AppComponent`.
You can’t perform that action at this time.
0 commit comments