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

Function assertElementNodes

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

Source from the content-addressed store, hash-verified

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