MCPcopy Index your code
hub / github.com/angular/angular / getDirectiveDefOrThrow

Function getDirectiveDefOrThrow

packages/core/src/render3/def_getters.ts:44–54  ·  view source on GitHub ↗
(type: any)

Source from the content-addressed store, hash-verified

42}
43
44export function getDirectiveDefOrThrow<T>(type: any): DirectiveDef<T> | never {
45 const def = getDirectiveDef<T>(type);
46 if (!def) {
47 throw new RuntimeError(
48 RuntimeErrorCode.MISSING_DIRECTIVE_DEFINITION,
49 (typeof ngDevMode === 'undefined' || ngDevMode) &&
50 `Type ${stringify(type)} does not have 'ɵdir' property.`,
51 );
52 }
53 return def;
54}
55
56export function getDirectiveDef<T>(type: any): DirectiveDef<T> | null {
57 assertTypeDefined(type, '@Directive');

Callers 1

createRootTViewFunction · 0.90

Calls 2

stringifyFunction · 0.90
getDirectiveDefFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…