fix(TemplateParser): match element and attributes regardless the namespace
This commit is contained in:
@ -908,6 +908,24 @@ Property binding a not used by any directive on an embedded template ("[ERROR ->
|
||||
]);
|
||||
});
|
||||
|
||||
it('should support directive in namespace', () => {
|
||||
var tagSel = CompileDirectiveMetadata.create(
|
||||
{selector: 'circle', type: new CompileTypeMetadata({name: 'elDir'})});
|
||||
var attrSel = CompileDirectiveMetadata.create(
|
||||
{selector: '[href]', type: new CompileTypeMetadata({name: 'attrDir'})});
|
||||
|
||||
expect(humanizeTplAstSourceSpans(
|
||||
parse('<svg><circle /><use xlink:href="Port" /></svg>', [tagSel, attrSel])))
|
||||
.toEqual([
|
||||
[ElementAst, '@svg:svg', '<svg>'],
|
||||
[ElementAst, '@svg:circle', '<circle />'],
|
||||
[DirectiveAst, tagSel, '<circle />'],
|
||||
[ElementAst, '@svg:use', '<use xlink:href="Port" />'],
|
||||
[AttrAst, '@xlink:href', 'Port', 'xlink:href="Port"'],
|
||||
[DirectiveAst, attrSel, '<use xlink:href="Port" />'],
|
||||
]);
|
||||
});
|
||||
|
||||
it('should support directive property', () => {
|
||||
var dirA = CompileDirectiveMetadata.create(
|
||||
{selector: 'div', type: new CompileTypeMetadata({name: 'DirA'}), inputs: ['aProp']});
|
||||
|
Reference in New Issue
Block a user