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

Function verifySemanticsOfNgModuleImport

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

Source from the content-addressed store, hash-verified

411 }
412
413 function verifySemanticsOfNgModuleImport(type: Type<any>, importingModule: Type<any>) {
414 type = resolveForwardRef(type);
415
416 const directiveDef = getComponentDef(type) || getDirectiveDef(type);
417 if (directiveDef !== null && !directiveDef.standalone) {
418 throw new Error(
419 `Unexpected directive '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`,
420 );
421 }
422
423 const pipeDef = getPipeDef(type);
424 if (pipeDef !== null && !pipeDef.standalone) {
425 throw new Error(
426 `Unexpected pipe '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`,
427 );
428 }
429 }
430}
431
432function unwrapModuleWithProvidersImports(

Callers 1

Calls 4

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

Tested by

no test coverage detected