* 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)
| 157 | * @param newValue The new class list to write. |
| 158 | */ |
| 159 | function writeDirectClass(renderer: Renderer, element: RElement, newValue: string) { |
| 160 | ngDevMode && assertString(newValue, "'newValue' should be a string"); |
| 161 | if (newValue === '') { |
| 162 | // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`. |
| 163 | renderer.removeAttribute(element, 'class'); |
| 164 | } else { |
| 165 | renderer.setAttribute(element, 'class', newValue); |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | /** Sets up the static DOM attributes on an `RNode`. */ |
| 170 | export function setupStaticAttributes(renderer: Renderer, element: RElement, tNode: TNode) { |
no test coverage detected