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

Function verifyDirectivesHaveSelector

packages/core/src/render3/jit/module.ts:322–328  ·  view source on GitHub ↗

* Checks that a directive declared in the module actually has a selector. * * This does the following: * 1. Reads the directive definition off the type. This also finds a definition that the type * inherited from a base class. * 2. Skips the check if the type is really a component

(type: Type<any>)

Source from the content-addressed store, hash-verified

320 * user to add one.
321 */
322 function verifyDirectivesHaveSelector(type: Type<any>): void {
323 type = resolveForwardRef(type);
324 const def = getDirectiveDef(type);
325 if (!getComponentDef(type) && !getPipeDef(type) && def && def.selectors.length == 0) {
326 errors.push(`Directive ${stringifyForError(type)} has no selector, please add it!`);
327 }
328 }
329
330 function verifyNotStandalone(type: Type<any>, moduleType: NgModuleType): void {
331 type = resolveForwardRef(type);

Callers

nothing calls this directly

Calls 6

resolveForwardRefFunction · 0.90
getDirectiveDefFunction · 0.90
getComponentDefFunction · 0.90
getPipeDefFunction · 0.90
stringifyForErrorFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected