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

Function assertDirectiveDef

packages/core/src/render3/assert.ts:124–130  ·  view source on GitHub ↗
(obj: any)

Source from the content-addressed store, hash-verified

122 * an interface, so we can't do a direct instanceof check.
123 */
124export function assertDirectiveDef<T>(obj: any): asserts obj is DirectiveDef<T> {
125 if (obj.type === undefined || obj.selectors == undefined || obj.inputs === undefined) {
126 throwError(
127 `Expected a DirectiveDef/ComponentDef and this object does not seem to have the expected shape.`,
128 );
129 }
130}
131
132export function assertIndexInDeclRange(tView: TView, index: number) {
133 assertBetween(HEADER_OFFSET, tView.bindingStartIndex, index);

Callers 1

getNodeInjectableFunction · 0.90

Calls 1

throwErrorFunction · 0.90

Tested by

no test coverage detected