MCPcopy Index your code
hub / github.com/angular/angular / countBindings

Function countBindings

packages/core/src/render3/i18n/i18n_parse.ts:477–487  ·  view source on GitHub ↗

* Count the number of bindings in the given `opCodes`. * * It could be possible to speed this up, by passing the number of bindings found back from * `generateBindingUpdateOpCodes()` to `i18nAttributesFirstPass()` but this would then require more * complexity in the code and/or transient objects

(opCodes: I18nUpdateOpCodes)

Source from the content-addressed store, hash-verified

475 * contain multiple i18n bound attributes, it seems like this is a reasonable compromise.
476 */
477function countBindings(opCodes: I18nUpdateOpCodes): number {
478 let count = 0;
479 for (let i = 0; i < opCodes.length; i++) {
480 const opCode = opCodes[i];
481 // Bindings are negative numbers.
482 if (typeof opCode === 'number' && opCode < 0) {
483 count++;
484 }
485 }
486 return count;
487}
488
489/**
490 * Convert binding index to mask bit.

Callers 1

i18nAttributesFirstPassFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…