Move normalizeTemplateAttributes method to DirectiveParser
This commit is contained in:
parent
91dc1925a1
commit
d0730431d0
@ -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"');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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"');
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user