MCPcopy
hub / github.com/angular/angular / getClassListFromValue

Function getClassListFromValue

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

Source from the content-addressed store, hash-verified

268 * Gets the list of classes from a passed in value
269 */
270export function getClassListFromValue(value: string | AnimationClassBindingFn): string[] | null {
271 const classes = typeof value === 'function' ? value() : value;
272 let classList: string[] | null = Array.isArray(classes) ? classes : null;
273 if (typeof classes === 'string') {
274 classList = classes
275 .trim()
276 .split(/\s+/)
277 .filter((k) => k);
278 }
279 return classList;
280}
281
282/**
283 * 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…