docs(di): fix code snippet
This commit is contained in:
parent
bf1437e2c7
commit
1797898f90
|
@ -302,10 +302,10 @@ include ../../../../_includes/_util-fns
|
||||||
Mission accomplished! We don't even need the Angular Dependency Injection system to test the `HeroesComponent`.
|
Mission accomplished! We don't even need the Angular Dependency Injection system to test the `HeroesComponent`.
|
||||||
We simply create a bew `HeroesComponent` with a mock service and poke at it:
|
We simply create a bew `HeroesComponent` with a mock service and poke at it:
|
||||||
```
|
```
|
||||||
it("should have heroes when created") {
|
it("should have heroes when created", () => {
|
||||||
let hc = new HeroesComponent(mockService);
|
let hc = new HeroesComponent(mockService);
|
||||||
expect(hc.heroes.length).toEqual(mockService.getHeroes().length);
|
expect(hc.heroes.length).toEqual(mockService.getHeroes().length);
|
||||||
}
|
})
|
||||||
```
|
```
|
||||||
### When the service needs a service
|
### When the service needs a service
|
||||||
Our `HeroService` is very simple. It doesn't have any dependencies of its own.
|
Our `HeroService` is very simple. It doesn't have any dependencies of its own.
|
||||||
|
|
Loading…
Reference in New Issue