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

Function applyTAttributes

packages/core/test/render3/instructions/styling_spec.ts:511–529  ·  view source on GitHub ↗
(attrs: TAttributes | null)

Source from the content-addressed store, hash-verified

509}
510
511function applyTAttributes(attrs: TAttributes | null) {
512 if (attrs === null) return;
513 const div: HTMLElement = getLView()[HEADER_OFFSET];
514 let mode: AttributeMarker = AttributeMarker.ImplicitAttributes;
515 for (let i = 0; i < attrs.length; i++) {
516 const item = attrs[i];
517 if (typeof item === 'number') {
518 mode = item;
519 } else if (typeof item === 'string') {
520 if (mode == AttributeMarker.ImplicitAttributes) {
521 div.setAttribute(item, attrs[++i] as string);
522 } else if (mode == AttributeMarker.Classes) {
523 div.classList.add(item);
524 } else if (mode == AttributeMarker.Styles) {
525 div.style.setProperty(item, attrs[++i] as string);
526 }
527 }
528 }
529}
530
531function activateHostBindings(directiveIndex: number) {
532 const bindingRootIndex = getBindingRootIndexFromDirectiveIndex(directiveIndex);

Callers 2

givenTemplateAttrsFunction · 0.85
givenDirectiveAttrsFunction · 0.85

Calls 4

getLViewFunction · 0.90
setAttributeMethod · 0.65
addMethod · 0.65
setPropertyMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…