MCPcopy
hub / github.com/angular/angular / assertElementNodes

Function assertElementNodes

packages/core/src/animation/utils.ts:56–63  ·  view source on GitHub ↗
(nativeElement: Element, instruction: string)

Source from the content-addressed store, hash-verified

54 * Asserts a given native element is an actual Element node and not something like a comment node.
55 */
56export function assertElementNodes(nativeElement: Element, instruction: string) {
57 if ((nativeElement as Node).nodeType !== Node.ELEMENT_NODE) {
58 throw new RuntimeError(
59 RuntimeErrorCode.ANIMATE_INVALID_VALUE,
60 `'${instruction}' can only be used on an element node, got ${stringify((nativeElement as Node).nodeType)}`,
61 );
62 }
63}
64
65/**
66 * trackEnterClasses is necessary in the case of composition where animate.enter

Callers 4

runEnterAnimationFunction · 0.90
runLeaveAnimationsFunction · 0.90

Calls 1

stringifyFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…