refactor(ElementBinderBuilder): refactor pipes support

This commit is contained in:
Victor Berchet 2015-03-06 13:22:30 +01:00
parent 0d1dece7b4
commit 86e9dd68a4
1 changed files with 3 additions and 5 deletions

View File

@ -208,9 +208,8 @@ export class ElementBinderBuilder extends CompileStep {
var annotation = directive.annotation; var annotation = directive.annotation;
if (isBlank(annotation.bind)) continue; if (isBlank(annotation.bind)) continue;
StringMapWrapper.forEach(annotation.bind, (bindConfig, dirProp) => { StringMapWrapper.forEach(annotation.bind, (bindConfig, dirProp) => {
var bindConfigParts = this._splitBindConfig(bindConfig); var pipes = this._splitBindConfig(bindConfig);
var elProp = bindConfigParts[0]; var elProp = ListWrapper.removeAt(pipes, 0);
var pipes = ListWrapper.slice(bindConfigParts, 1, bindConfigParts.length);
var bindingAst = isPresent(compileElement.propertyBindings) ? var bindingAst = isPresent(compileElement.propertyBindings) ?
MapWrapper.get(compileElement.propertyBindings, elProp) : MapWrapper.get(compileElement.propertyBindings, elProp) :
@ -238,8 +237,7 @@ export class ElementBinderBuilder extends CompileStep {
} }
_splitBindConfig(bindConfig:string) { _splitBindConfig(bindConfig:string) {
var parts = StringWrapper.split(bindConfig, RegExpWrapper.create("\\|")); return ListWrapper.map(bindConfig.split('|'), (s) => s.trim());
return ListWrapper.map(parts, (s) => s.trim());
} }
_resolvePropertyName(attrName:string) { _resolvePropertyName(attrName:string) {