refactor(pipes): rename PipeRegistry to Pipes

BREAKING CHANGE:
    This change renames all instances of PipeRegistry to Pipes.
    As part of this change, the former "defaultPipes" export is
    now a Pipes instance, instead of a map. The map that was previously
    called "defaultPipes" no longer exists, but may be accessed via
    defaultPipes.config.
This commit is contained in:
Jeff Cross
2015-07-09 10:34:51 -07:00
parent 8b3efdf229
commit 9a70f84e60
20 changed files with 90 additions and 104 deletions

View File

@ -1,6 +1,6 @@
import {Directive, onCheck} from 'angular2/annotations';
import {ElementRef} from 'angular2/core';
import {PipeRegistry} from 'angular2/src/change_detection/pipes/pipes';
import {Pipes} from 'angular2/src/change_detection/pipes/pipes';
import {Pipe} from 'angular2/src/change_detection/pipes/pipe';
import {Renderer} from 'angular2/src/render/api';
import {KeyValueChanges} from 'angular2/src/change_detection/pipes/keyvalue_changes';
@ -35,8 +35,7 @@ export class CSSClass {
_pipe: Pipe;
_rawClass;
constructor(private _pipeRegistry: PipeRegistry, private _ngEl: ElementRef,
private _renderer: Renderer) {}
constructor(private _pipes: Pipes, private _ngEl: ElementRef, private _renderer: Renderer) {}
set rawClass(v) {
this._cleanupClasses(this._rawClass);
@ -46,7 +45,7 @@ export class CSSClass {
}
this._rawClass = v;
this._pipe = this._pipeRegistry.get(isListLikeIterable(v) ? 'iterableDiff' : 'keyValDiff', v);
this._pipe = this._pipes.get(isListLikeIterable(v) ? 'iterableDiff' : 'keyValDiff', v);
}
onCheck(): void {

View File

@ -1,12 +1,5 @@
import {Directive} from 'angular2/annotations';
import {
ViewContainerRef,
ViewRef,
ProtoViewRef,
PipeRegistry,
onCheck,
Pipe
} from 'angular2/angular2';
import {ViewContainerRef, ViewRef, ProtoViewRef, Pipes, onCheck, Pipe} from 'angular2/angular2';
import {isPresent, isBlank} from 'angular2/src/facade/lang';
/**
@ -47,7 +40,7 @@ export class NgFor {
_pipe: Pipe;
constructor(private viewContainer: ViewContainerRef, private protoViewRef: ProtoViewRef,
private pipes: PipeRegistry) {}
private pipes: Pipes) {}
set ngForOf(value: any) {
this._ngForOf = value;

View File

@ -1,7 +1,7 @@
import {Directive, onCheck} from 'angular2/annotations';
import {ElementRef} from 'angular2/core';
import {Pipe} from 'angular2/src/change_detection/pipes/pipe';
import {PipeRegistry} from 'angular2/src/change_detection/pipes/pipes';
import {Pipes} from 'angular2/src/change_detection/pipes/pipes';
import {KeyValueChanges} from 'angular2/src/change_detection/pipes/keyvalue_changes';
import {isPresent, print} from 'angular2/src/facade/lang';
import {Renderer} from 'angular2/src/render/api';
@ -34,12 +34,11 @@ export class NgStyle {
_pipe: Pipe;
_rawStyle;
constructor(private _pipeRegistry: PipeRegistry, private _ngEl: ElementRef,
private _renderer: Renderer) {}
constructor(private _pipes: Pipes, private _ngEl: ElementRef, private _renderer: Renderer) {}
set rawStyle(v) {
this._rawStyle = v;
this._pipe = this._pipeRegistry.get('keyValDiff', this._rawStyle);
this._pipe = this._pipes.get('keyValDiff', this._rawStyle);
}
onCheck() {