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

Function elementHasClassList

packages/core/src/animation/utils.ts:332–337  ·  view source on GitHub ↗
(element: HTMLElement, classList: string[])

Source from the content-addressed store, hash-verified

330 * Checks if a given element contains the classes is a provided list
331 */
332export function elementHasClassList(element: HTMLElement, classList: string[]): boolean {
333 for (const className of classList) {
334 if (element.classList.contains(className)) return true;
335 }
336 return false;
337}
338
339/** Gets the target of an event while accounting for Shadow DOM. */
340export function getEventTarget<T extends EventTarget>(event: Event): T | null {

Callers 1

Calls 1

containsMethod · 0.65

Tested by

no test coverage detected