diff --git a/modules/@angular/compiler/src/template_parser.ts b/modules/@angular/compiler/src/template_parser.ts index ca2817e8d5..92663ae8b6 100644 --- a/modules/@angular/compiler/src/template_parser.ts +++ b/modules/@angular/compiler/src/template_parser.ts @@ -414,7 +414,9 @@ 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 + ' ' + attr.value; + templateBindingsSource = (attr.value.length == 0) ? + key : + key + ' ' + StringWrapper.replaceAll(attr.value, /:/g, ' '); } 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 b0d5144b61..ee993a3e62 100644 --- a/modules/@angular/compiler/test/template_parser_spec.ts +++ b/modules/@angular/compiler/test/template_parser_spec.ts @@ -460,7 +460,7 @@ export function main() { it('should support optional directive properties', () => { var dirA = CompileDirectiveMetadata.create({ selector: 'div', - type: new CompileTypeMetadata({moduleUrl: someModuleUrl, name: 'DirA'}), + type: new CompileTypeMetadata({moduleUrl: someModuleUrl, name: 'Dir'}), inputs: ['a'] }); expect(humanizeTplAst(parse('
', [dirA]))) @@ -1009,6 +1009,18 @@ There is no directive with "exportAs" set to "dirA" ("
]#a="dirA">< [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'] + ]); + }); }); });