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

Function mapPropName

packages/core/src/render3/instructions/shared.ts:244–252  ·  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

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

Callers 1

setPropertyAndInputsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected