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

Function ingestDomProperty

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

Source from the content-addressed store, hash-verified

187// TODO: We should refactor the parser to use the same types and structures for host bindings as
188// with ordinary components. This would allow us to share a lot more ingestion code.
189export function ingestDomProperty(
190 job: HostBindingCompilationJob,
191 property: e.ParsedProperty,
192 bindingKind: ir.BindingKind,
193 securityContexts: SecurityContext[],
194): void {
195 let expression: o.Expression | ir.Interpolation;
196 const ast = property.expression.ast;
197 if (ast instanceof e.Interpolation) {
198 expression = new ir.Interpolation(
199 ast.strings,
200 ast.expressions.map((expr) => convertAst(expr, job, property.sourceSpan)),
201 [],
202 );
203 } else {
204 expression = convertAst(ast, job, property.sourceSpan);
205 }
206 job.root.update.push(
207 ir.createBindingOp(
208 job.root.xref,
209 bindingKind,
210 property.name,
211 expression,
212 null,
213 securityContexts,
214 false,
215 false,
216 null,
217 /* TODO: How do Host bindings handle i18n attrs? */ null,
218 property.sourceSpan,
219 ),
220 );
221}
222
223export function ingestHostAttribute(
224 job: HostBindingCompilationJob,

Callers 1

ingestHostBindingFunction · 0.85

Calls 3

convertAstFunction · 0.85
mapMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected