From 8847580fd7083052f54555ebb2136dfae1535644 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Tue, 7 Jun 2016 09:24:57 -0700 Subject: [PATCH] Revert "fix(compiler): add ability to parse : in * directives" This reverts commit 53628e19ac902a73b47cfe617ca3ed3bd3d7cc9e. as it breaks pipe arguments in `*ngFor`, ... See #9062 Closes #9063 --- modules/@angular/compiler/src/template_parser.ts | 4 +--- .../@angular/compiler/test/template_parser_spec.ts | 14 +------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/modules/@angular/compiler/src/template_parser.ts b/modules/@angular/compiler/src/template_parser.ts index 1da5dcedec..e02dab4f78 100644 --- a/modules/@angular/compiler/src/template_parser.ts +++ b/modules/@angular/compiler/src/template_parser.ts @@ -439,9 +439,7 @@ class TemplateParseVisitor implements HtmlAstVisitor { templateBindingsSource = attr.value; } else if (attr.name.startsWith(TEMPLATE_ATTR_PREFIX)) { var key = attr.name.substring(TEMPLATE_ATTR_PREFIX.length); // remove the star - templateBindingsSource = (attr.value.length == 0) ? - key : - key + ' ' + StringWrapper.replaceAll(attr.value, /:/g, ' '); + templateBindingsSource = (attr.value.length == 0) ? key : key + ' ' + attr.value; } if (isPresent(templateBindingsSource)) { var bindings = this._parseTemplateBindings(templateBindingsSource, attr.sourceSpan); diff --git a/modules/@angular/compiler/test/template_parser_spec.ts b/modules/@angular/compiler/test/template_parser_spec.ts index db363148f1..3248d6c26d 100644 --- a/modules/@angular/compiler/test/template_parser_spec.ts +++ b/modules/@angular/compiler/test/template_parser_spec.ts @@ -508,7 +508,7 @@ export function main() { it('should support optional directive properties', () => { var dirA = CompileDirectiveMetadata.create({ selector: 'div', - type: new CompileTypeMetadata({moduleUrl: someModuleUrl, name: 'Dir'}), + type: new CompileTypeMetadata({moduleUrl: someModuleUrl, name: 'DirA'}), inputs: ['a'] }); expect(humanizeTplAst(parse('
', [dirA]))) @@ -1067,18 +1067,6 @@ Reference "#a" is defined several times ("
]#a>
[ElementAst, 'div'] ]); }); - - it('should work with *... and :', () => { - var dirA = CompileDirectiveMetadata.create( - {selector: '[a]', type: new CompileTypeMetadata({name: 'DirA'}), inputs: ['a', 'b']}); - expect(humanizeTplAst(parse('
', [dirA]))) - .toEqual([ - [EmbeddedTemplateAst], - [DirectiveAst, dirA], - [BoundDirectivePropertyAst, 'a', 'b'], - [ElementAst, 'div'] - ]); - }); }); });