Skip to content

Commit

Permalink
fix(Pipe): pure is an optional argument
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb committed Oct 29, 2015
1 parent fc016b5 commit 7ba426c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/angular2/src/core/metadata/directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -948,12 +948,14 @@ export class ComponentMetadata extends DirectiveMetadata {
/**
* Declare reusable pipe function.
*
* A "pure" pipe is only re-evaluated when any of its input or arguments changes.
*
* When not specified, pipes default to being pure.
*
* ### Example
*
* ```
* @Pipe({
* name: 'lowercase'
* })
* @Pipe({name: 'lowercase'})
* class Lowercase {
* transform(v, args) { return v.toLowerCase(); }
* }
Expand All @@ -965,7 +967,7 @@ export class PipeMetadata extends InjectableMetadata {
/** @internal */
_pure: boolean;

constructor({name, pure}: {name: string, pure: boolean}) {
constructor({name, pure}: {name: string, pure?: boolean}) {
super();
this.name = name;
this._pure = pure;
Expand Down

0 comments on commit 7ba426c

Please sign in to comment.