fix(Pipe): pure is an optional argument
This commit is contained in:
parent
fc016b59dc
commit
7ba426c3e6
|
@ -948,12 +948,14 @@ export class ComponentMetadata extends DirectiveMetadata {
|
||||||
/**
|
/**
|
||||||
* Declare reusable pipe function.
|
* 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
|
* ### Example
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* @Pipe({
|
* @Pipe({name: 'lowercase'})
|
||||||
* name: 'lowercase'
|
|
||||||
* })
|
|
||||||
* class Lowercase {
|
* class Lowercase {
|
||||||
* transform(v, args) { return v.toLowerCase(); }
|
* transform(v, args) { return v.toLowerCase(); }
|
||||||
* }
|
* }
|
||||||
|
@ -965,7 +967,7 @@ export class PipeMetadata extends InjectableMetadata {
|
||||||
/** @internal */
|
/** @internal */
|
||||||
_pure: boolean;
|
_pure: boolean;
|
||||||
|
|
||||||
constructor({name, pure}: {name: string, pure: boolean}) {
|
constructor({name, pure}: {name: string, pure?: boolean}) {
|
||||||
super();
|
super();
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this._pure = pure;
|
this._pure = pure;
|
||||||
|
|
Loading…
Reference in New Issue