MCPcopy Create free account
hub / github.com/angular/angular / ingestDomProperty

Function ingestDomProperty

packages/compiler/src/template/pipeline/src/ingest.ts:145–177  ·  view source on GitHub ↗
(
  job: HostBindingCompilationJob,
  property: e.ParsedProperty,
  bindingKind: ir.BindingKind,
  securityContexts: SecurityContext[],
)

Source from the content-addressed store, hash-verified

143// TODO: We should refactor the parser to use the same types and structures for host bindings as
144// with ordinary components. This would allow us to share a lot more ingestion code.
145export function ingestDomProperty(
146 job: HostBindingCompilationJob,
147 property: e.ParsedProperty,
148 bindingKind: ir.BindingKind,
149 securityContexts: SecurityContext[],
150): void {
151 let expression: o.Expression | ir.Interpolation;
152 const ast = property.expression.ast;
153 if (ast instanceof e.Interpolation) {
154 expression = new ir.Interpolation(
155 ast.strings,
156 ast.expressions.map((expr) => convertAst(expr, job, property.sourceSpan)),
157 [],
158 );
159 } else {
160 expression = convertAst(ast, job, property.sourceSpan);
161 }
162 job.root.update.push(
163 ir.createBindingOp(
164 job.root.xref,
165 bindingKind,
166 property.name,
167 expression,
168 null,
169 securityContexts,
170 false,
171 false,
172 null,
173 /* TODO: How do Host bindings handle i18n attrs? */ null,
174 property.sourceSpan,
175 ),
176 );
177}
178
179export function ingestHostAttribute(
180 job: HostBindingCompilationJob,

Callers 1

ingestHostBindingFunction · 0.85

Calls 3

convertAstFunction · 0.85
mapMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected