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

Function assertElementNodes

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

Source from the content-addressed store, hash-verified

56 * Asserts a given native element is an actual Element node and not something like a comment node.
57 */
58export function assertElementNodes(nativeElement: Element, instruction: string) {
59 if ((nativeElement as Node).nodeType !== Node.ELEMENT_NODE) {
60 throw new RuntimeError(
61 RuntimeErrorCode.ANIMATE_INVALID_VALUE,
62 `'${instruction}' can only be used on an element node, got ${stringify((nativeElement as Node).nodeType)}`,
63 );
64 }
65}
66
67/**
68 * 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