Revert "fix(compiler): add ability to parse : in * directives"

This reverts commit 53628e19ac.
as it breaks pipe arguments in `*ngFor`, ...

See #9062
Closes #9063
This commit is contained in:
Tobias Bosch 2016-06-07 09:24:57 -07:00
parent cf3548a02f
commit 8847580fd7
2 changed files with 2 additions and 16 deletions

View File

@ -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);

View File

@ -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('<div></div>', [dirA])))
@ -1067,18 +1067,6 @@ Reference "#a" is defined several times ("<div #a></div><div [ERROR ->]#a></div>
[ElementAst, 'div']
]);
});
it('should work with *... and :', () => {
var dirA = CompileDirectiveMetadata.create(
{selector: '[a]', type: new CompileTypeMetadata({name: 'DirA'}), inputs: ['a', 'b']});
expect(humanizeTplAst(parse('<div *a="b: foo">', [dirA])))
.toEqual([
[EmbeddedTemplateAst],
[DirectiveAst, dirA],
[BoundDirectivePropertyAst, 'a', 'b'],
[ElementAst, 'div']
]);
});
});
});