* Write `className` to `RElement`. * * This function does direct write without any reconciliation. Used for writing initial values, so * that static styling values do not pull in the style parser. * * @param renderer Renderer to use * @param element The element which needs to be updated. * @p
(renderer: Renderer, element: RElement, newValue: string)
| 128 | * @param newValue The new class list to write. |
| 129 | */ |
| 130 | function writeDirectClass(renderer: Renderer, element: RElement, newValue: string) { |
| 131 | ngDevMode && assertString(newValue, "'newValue' should be a string"); |
| 132 | if (newValue === '') { |
| 133 | // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`. |
| 134 | renderer.removeAttribute(element, 'class'); |
| 135 | } else { |
| 136 | renderer.setAttribute(element, 'class', newValue); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | /** Sets up the static DOM attributes on an `RNode`. */ |
| 141 | export function setupStaticAttributes(renderer: Renderer, element: RElement, tNode: TNode) { |
no test coverage detected
searching dependent graphs…