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

Function elementHasClassList

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

Source from the content-addressed store, hash-verified

305 * Checks if a given element contains the classes is a provided list
306 */
307export function elementHasClassList(element: HTMLElement, classList: string[]): boolean {
308 for (const className of classList) {
309 if (element.classList.contains(className)) return true;
310 }
311 return false;
312}
313
314/** Gets the target of an event while accounting for Shadow DOM. */
315export function getEventTarget<T extends EventTarget>(event: Event): T | null {

Callers 1

Calls 1

containsMethod · 0.65

Tested by

no test coverage detected