feat(change_detection): change binding syntax to explicitly specify pipes
This commit is contained in:
@ -16,6 +16,16 @@ import {
|
||||
|
||||
import {NO_CHANGE, Pipe} from './pipe';
|
||||
|
||||
export class ArrayChangesFactory {
|
||||
supports(obj):boolean {
|
||||
return ArrayChanges.supportsObj(obj);
|
||||
}
|
||||
|
||||
create():Pipe {
|
||||
return new ArrayChanges();
|
||||
}
|
||||
}
|
||||
|
||||
export class ArrayChanges extends Pipe {
|
||||
_collection;
|
||||
_length:int;
|
||||
|
@ -1,6 +1,16 @@
|
||||
import {isBlank} from 'angular2/src/facade/lang';
|
||||
import {Pipe, NO_CHANGE} from './pipe';
|
||||
|
||||
export class NullPipeFactory {
|
||||
supports(obj):boolean {
|
||||
return NullPipe.supportsObj(obj);
|
||||
}
|
||||
|
||||
create():Pipe {
|
||||
return new NullPipe();
|
||||
}
|
||||
}
|
||||
|
||||
export class NullPipe extends Pipe {
|
||||
called:boolean;
|
||||
constructor() {
|
||||
|
@ -16,12 +16,12 @@ export class PipeRegistry {
|
||||
}
|
||||
|
||||
var matchingConfig = ListWrapper.find(listOfConfigs,
|
||||
(pipeConfig) => pipeConfig["supports"](obj));
|
||||
(pipeConfig) => pipeConfig.supports(obj));
|
||||
|
||||
if (isBlank(matchingConfig)) {
|
||||
throw new BaseException(`Cannot find a pipe for type '${type}' object '${obj}'`);
|
||||
}
|
||||
|
||||
return matchingConfig["pipe"]();
|
||||
return matchingConfig.create();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user