diff --git a/public/docs/ts/latest/testing/testing-an-angular-pipe.jade b/public/docs/ts/latest/testing/testing-an-angular-pipe.jade index 15bf92ef5e..9db9ea27d0 100644 --- a/public/docs/ts/latest/testing/testing-an-angular-pipe.jade +++ b/public/docs/ts/latest/testing/testing-an-angular-pipe.jade @@ -16,10 +16,10 @@ code-example(format="." language="html" escape="html"). The code for `InitCapsPipe` in `init-caps-pipe.ts` is quite brief: ``` - import {Pipe} from 'angular2/core'; + import {Pipe, PipeTransform} from 'angular2/core'; @Pipe({ name: 'initCaps' }) - export class InitCapsPipe { + export class InitCapsPipe implements PipeTransform{ transform(value: string) { return value.toLowerCase().replace(/(?:^|\s)[a-z]/g, function(m) { return m.toUpperCase(); @@ -65,12 +65,13 @@ code-example(format="" language="html" escape="html"). :marked We are writing an Angular application afterall and we were going to need Angular sooner or later. That time has come. - The `InitCapsPipe` clearly depends on Angular as is clear in the first few lines: + + The `InitCapsPipe` depends on Angular as is clear in the first few lines: code-example(format=""). - import {Pipe} from 'angular2/core'; + import {Pipe, PipeTransform} from 'angular2/core'; @Pipe({ name: 'initCaps' }) - export class InitCapsPipe { ... } + export class InitCapsPipe implements PipeTransform { ... } :marked **Open** `unit-tests.html` @@ -159,5 +160,4 @@ figure.image-display What about testing parts that *are themselves asynchronous*? - Let's test a service with a public asynchronous method that fetches heroes - from a remote server. + Let's test a service with a public asynchronous method that fetches heroes from a remote server.