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

Function verifySemanticsOfNgModuleImport

packages/core/src/render3/jit/module.ts:398–414  ·  view source on GitHub ↗
(type: Type<any>, importingModule: Type<any>)

Source from the content-addressed store, hash-verified

396 }
397
398 function verifySemanticsOfNgModuleImport(type: Type<any>, importingModule: Type<any>) {
399 type = resolveForwardRef(type);
400
401 const directiveDef = getComponentDef(type) || getDirectiveDef(type);
402 if (directiveDef !== null && !directiveDef.standalone) {
403 throw new Error(
404 `Unexpected directive '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`,
405 );
406 }
407
408 const pipeDef = getPipeDef(type);
409 if (pipeDef !== null && !pipeDef.standalone) {
410 throw new Error(
411 `Unexpected pipe '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`,
412 );
413 }
414 }
415}
416
417function unwrapModuleWithProvidersImports(

Callers 1

Calls 4

resolveForwardRefFunction · 0.90
getComponentDefFunction · 0.90
getDirectiveDefFunction · 0.90
getPipeDefFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…