convertEmbeddedTemplate function

Element convertEmbeddedTemplate(
  1. EmbeddedTemplateAst embeddedTemplate,
  2. CompileElement compileElement,
  3. CompileDirectiveMetadata compileDirectiveMetadata
)

Implementation

ir.Element convertEmbeddedTemplate(
  ast.EmbeddedTemplateAst embeddedTemplate,
  CompileElement compileElement,
  CompileDirectiveMetadata compileDirectiveMetadata,
) {
  var directives = convertMatchedDirectives(
    embeddedTemplate.directives,
    compileElement,
    compileDirectiveMetadata,
  );
  directives = directives.map(optimizeLifecycles).toList();

  var embeddedView = ir.EmbeddedView(
    embeddedTemplate.children,
  );

  embeddedView.compileView = compileElement.embeddedView;

  return ir.Element(compileElement, [], [], directives, [], [embeddedView]);
}