docs(di): fix code snippet

This commit is contained in:
Pascal Precht 2015-10-19 23:48:46 +01:00 committed by Naomi Black
parent bf1437e2c7
commit 1797898f90
1 changed files with 2 additions and 2 deletions

View File

@ -302,10 +302,10 @@ include ../../../../_includes/_util-fns
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:
```
it("should have heroes when created") {
it("should have heroes when created", () => {
let hc = new HeroesComponent(mockService);
expect(hc.heroes.length).toEqual(mockService.getHeroes().length);
}
})
```
### When the service needs a service
Our `HeroService` is very simple. It doesn't have any dependencies of its own.