diff --git a/src/parsers/abstract-template.parser.ts b/src/parsers/abstract-template.parser.ts index 791ad26..e50d385 100644 --- a/src/parsers/abstract-template.parser.ts +++ b/src/parsers/abstract-template.parser.ts @@ -20,13 +20,4 @@ export abstract class AbstractTemplateParser { return ''; } - /** - * Angular's `[attr]="'val'"` syntax is not valid HTML, - * so it can't be parsed by standard HTML parsers. - * This method replaces `[attr]="'val'""` with `attr="val"` - */ - protected _normalizeTemplateAttributes(template: string): string { - return template.replace(/\[([^\]]+)\]="'([^']*)'"/g, '$1="$2"'); - } - } diff --git a/src/parsers/directive.parser.ts b/src/parsers/directive.parser.ts index c44a9dd..c7114ea 100644 --- a/src/parsers/directive.parser.ts +++ b/src/parsers/directive.parser.ts @@ -43,4 +43,13 @@ export class DirectiveParser extends AbstractTemplateParser implements ParserInt return collection; } + /** + * Angular's `[attr]="'val'"` syntax is not valid HTML, + * so it can't be parsed by standard HTML parsers. + * This method replaces `[attr]="'val'""` with `attr="val"` + */ + protected _normalizeTemplateAttributes(template: string): string { + return template.replace(/\[([^\]]+)\]="'([^']*)'"/g, '$1="$2"'); + } + }