(type: Type<any>, importingModule: Type<any>)
| 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 | |
| 432 | function unwrapModuleWithProvidersImports( |
no test coverage detected