MCPcopy
hub / github.com/angular/angular / mapPropName

Function mapPropName

packages/core/src/render3/instructions/shared.ts:240–248  ·  view source on GitHub ↗

* Mapping between attributes names that don't correspond to their element property names. * * Performance note: this function is written as a series of if checks (instead of, say, a property * object lookup) for performance reasons - the series of `if` checks seems to be the fastest way of * map

(name: string)

Source from the content-addressed store, hash-verified

238 * Note: this mapping has to be kept in sync with the equivalent mappings in the compiler.
239 */
240function mapPropName(name: string): string {
241 if (name === 'class') return 'className';
242 if (name === 'for') return 'htmlFor';
243 if (name === 'formaction') return 'formAction';
244 if (name === 'innerHtml') return 'innerHTML';
245 if (name === 'readonly') return 'readOnly';
246 if (name === 'tabindex') return 'tabIndex';
247 return name;
248}
249
250export function setPropertyAndInputs<T>(
251 tNode: TNode,

Callers 1

setPropertyAndInputsFunction · 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…