visitEmbeddedTemplate method

  1. @override
TemplateAst visitEmbeddedTemplate(
  1. EmbeddedTemplateAst ast,
  2. CompileDirectiveMetadata? component
)
override

Implementation

@override
TemplateAst visitEmbeddedTemplate(
    EmbeddedTemplateAst ast, CompileDirectiveMetadata? component) {
  component = component!;
  _typeNgForLocals(component, ast.directives, ast.variables);

  // Add the local variables to the [CompileDirectiveMetadata] used in
  // children embedded templates.
  var scoped = CompileDirectiveMetadata.from(component,
      analyzedClass: AnalyzedClass.from(
        component.analyzedClass!,
        additionalLocals: {
          for (var v in ast.variables)
            if (v.dartType != null) v.name: v.dartType!,
        },
      ));

  return super.visitEmbeddedTemplate(ast, scoped);
}