fix(core): incorrectly validating properties on ng-content and ng-container (#37773)
Fixes the following issues related to how we validate properties during JIT: - The invalid property warning was printing `null` as the node name for `ng-content`. The problem is that when generating a template from `ng-content` we weren't capturing the node name. - We weren't running property validation on `ng-container` at all. This used to be supported on ViewEngine and seems like an oversight. In the process of making these changes, I found and cleaned up a few places where we were passing in `LView` unnecessarily. PR Close #37773
This commit is contained in:
@ -104,6 +104,8 @@ export class Template implements Node {
|
||||
}
|
||||
|
||||
export class Content implements Node {
|
||||
readonly name = 'ng-content';
|
||||
|
||||
constructor(
|
||||
public selector: string, public attributes: TextAttribute[],
|
||||
public sourceSpan: ParseSourceSpan, public i18n?: I18nMeta) {}
|
||||
|
@ -233,10 +233,10 @@ class HtmlAstToIvyAst implements html.Visitor {
|
||||
|
||||
// TODO(pk): test for this case
|
||||
parsedElement = new t.Template(
|
||||
(parsedElement as t.Element).name, hoistedAttrs.attributes, hoistedAttrs.inputs,
|
||||
hoistedAttrs.outputs, templateAttrs, [parsedElement], [/* no references */],
|
||||
templateVariables, element.sourceSpan, element.startSourceSpan, element.endSourceSpan,
|
||||
i18n);
|
||||
(parsedElement as t.Element | t.Content).name, hoistedAttrs.attributes,
|
||||
hoistedAttrs.inputs, hoistedAttrs.outputs, templateAttrs, [parsedElement],
|
||||
[/* no references */], templateVariables, element.sourceSpan, element.startSourceSpan,
|
||||
element.endSourceSpan, i18n);
|
||||
}
|
||||
if (isI18nRootElement) {
|
||||
this.inI18nBlock = false;
|
||||
|
Reference in New Issue
Block a user