Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions modules/angular2/src/core/change_detection/pipe_transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,23 @@
export interface PipeTransform { transform(value: any, args: any[]): any; }

/**
* To create a stateful Pipe, you should implement this interface.
* To create a stateful Pipe, you should implement this interface and set the `pure`
* parameter to `false` in the {@link PipeMetadata}.
*
* A stateful pipe may produce different output, given the same input. It is
* likely that a stateful pipe may contain state that should be cleaned up when
* a binding is destroyed. For example, a subscription to a stream of data may need to
* be disposed, or an interval may need to be cleared.
*
* ### Example ([live demo](http://plnkr.co/edit/hlaejwQAmWayxwc5YXQE?p=preview))
* ### Example ([live demo](http://plnkr.co/edit/i8pm5brO4sPaLxBx56MR?p=preview))
*
* In this example, a pipe is created to countdown its input value, updating it every
* 50ms. Because it maintains an internal interval, it automatically clears
* the interval when the binding is destroyed or the countdown completes.
*
* ```
* import {Pipe, PipeTransform} from 'angular2/angular2'
* @Pipe({name: 'countdown'})
* @Pipe({name: 'countdown', pure: false})
* class CountDown implements PipeTransform, PipeOnDestroy {
* remainingTime:Number;
* interval:SetInterval;
Expand Down
2 changes: 0 additions & 2 deletions modules/angular2/src/core/di/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ export class InjectableMetadata {
*
* @Injectable()
* class NeedsDependency {
* dependency;

* dependency;
* constructor(@Self() dependency:Dependency) {
* this.dependency = dependency;
Expand Down
6 changes: 3 additions & 3 deletions modules/angular2/src/core/metadata/di.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export class AttributeMetadata extends DependencyMetadata {
* <div #findme>...</div>
* </seeker>
*
* @Component({ selector: 'foo' })
* class seeker {
* @Component({ selector: 'seeker' })
* class Seeker {
* constructor(@Query('findme') elList: QueryList<ElementRef>) {...}
* }
* ```
Expand All @@ -120,7 +120,7 @@ export class AttributeMetadata extends DependencyMetadata {
* </seeker>
*
* @Component({
* selector: 'foo'
* selector: 'seeker'
* })
* class Seeker {
* constructor(@Query('findMe, findMeToo') elList: QueryList<ElementRef>) {...}
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/http/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function mergeOptions(defaultOpts, providedOpts, method, url): RequestOptions {
* ### Example
*
* ```
* http.get('people.json').observer({next: (value) => this.people = people});
* http.get('people.json').observer({next: (value) => this.people = value});
* ```
*
* The default construct used to perform requests, `XMLHttpRequest`, is abstracted as a "Backend" (
Expand Down