feat(change_detection): pass binding propagation config to pipe registry

This commit is contained in:
vsavkin
2015-02-27 13:38:25 -08:00
parent dd235f38a3
commit 8d85b839b6
21 changed files with 69 additions and 37 deletions

View File

@ -21,7 +21,7 @@ export class IterableChangesFactory {
return IterableChanges.supportsObj(obj);
}
create():Pipe {
create(bpc):Pipe {
return new IterableChanges();
}
}

View File

@ -8,7 +8,7 @@ export class KeyValueChangesFactory {
return KeyValueChanges.supportsObj(obj);
}
create():Pipe {
create(bpc):Pipe {
return new KeyValueChanges();
}
}

View File

@ -6,7 +6,7 @@ export class NullPipeFactory {
return NullPipe.supportsObj(obj);
}
create():Pipe {
create(bpc):Pipe {
return new NullPipe();
}
}

View File

@ -1,6 +1,7 @@
import {List, ListWrapper} from 'angular2/src/facade/collection';
import {isBlank, isPresent, BaseException, CONST} from 'angular2/src/facade/lang';
import {Pipe} from './pipe';
import {BindingPropagationConfig} from '../binding_propagation_config';
export class PipeRegistry {
config;
@ -9,7 +10,7 @@ export class PipeRegistry {
this.config = config;
}
get(type:string, obj):Pipe {
get(type:string, obj, bpc:BindingPropagationConfig):Pipe {
var listOfConfigs = this.config[type];
if (isBlank(listOfConfigs)) {
throw new BaseException(`Cannot find a pipe for type '${type}' object '${obj}'`);
@ -22,6 +23,6 @@ export class PipeRegistry {
throw new BaseException(`Cannot find a pipe for type '${type}' object '${obj}'`);
}
return matchingConfig.create();
return matchingConfig.create(bpc);
}
}