refactor(compiler): update template parse error message to ng-template (#19029)
PR Close #19029
This commit is contained in:
parent
6ac75a0674
commit
b56dd32454
@ -443,7 +443,7 @@ class TemplateParseVisitor implements html.Visitor {
|
|||||||
const identifier = bindParts[IDENT_KW_IDX];
|
const identifier = bindParts[IDENT_KW_IDX];
|
||||||
this._parseVariable(identifier, value, srcSpan, targetVars);
|
this._parseVariable(identifier, value, srcSpan, targetVars);
|
||||||
} else {
|
} else {
|
||||||
this._reportError(`"let-" is only supported on template elements.`, srcSpan);
|
this._reportError(`"let-" is only supported on ng-template elements.`, srcSpan);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (bindParts[KW_REF_IDX]) {
|
} else if (bindParts[KW_REF_IDX]) {
|
||||||
|
@ -1212,7 +1212,7 @@ There is no directive with "exportAs" set to "dirA" ("<div [ERROR ->]#a="dirA"><
|
|||||||
|
|
||||||
it('should report variables as errors', () => {
|
it('should report variables as errors', () => {
|
||||||
expect(() => parse('<div let-a></div>', [])).toThrowError(`Template parse errors:
|
expect(() => parse('<div let-a></div>', [])).toThrowError(`Template parse errors:
|
||||||
"let-" is only supported on template elements. ("<div [ERROR ->]let-a></div>"): TestComp@0:5`);
|
"let-" is only supported on ng-template elements. ("<div [ERROR ->]let-a></div>"): TestComp@0:5`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should report duplicate reference names', () => {
|
it('should report duplicate reference names', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user