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

Function getClassListFromValue

packages/core/src/animation/utils.ts:272–282  ·  view source on GitHub ↗
(value: string | AnimationClassBindingFn)

Source from the content-addressed store, hash-verified

270 * Gets the list of classes from a passed in value
271 */
272export function getClassListFromValue(value: string | AnimationClassBindingFn): string[] | null {
273 const classes = typeof value === 'function' ? value() : value;
274 let classList: string[] | null = Array.isArray(classes) ? classes : null;
275 if (typeof classes === 'string') {
276 classList = classes
277 .trim()
278 .split(/\s+/)
279 .filter((k) => k);
280 }
281 return classList;
282}
283
284/**
285 * Cancels any running enter animations on a given element to prevent them from interfering

Callers 2

runEnterAnimationFunction · 0.90
runLeaveAnimationsFunction · 0.90

Calls 3

valueFunction · 0.85
isArrayMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected