(type: Type<any>, suppressErrors: boolean)
| 344 | } |
| 345 | |
| 346 | function verifyDeclarationIsUnique(type: Type<any>, suppressErrors: boolean) { |
| 347 | type = resolveForwardRef(type); |
| 348 | const existingModule = ownerNgModule.get(type); |
| 349 | if (existingModule && existingModule !== moduleType) { |
| 350 | if (!suppressErrors) { |
| 351 | const modules = [existingModule, moduleType].map(stringifyForError).sort(); |
| 352 | errors.push( |
| 353 | `Type ${stringifyForError(type)} is part of the declarations of 2 modules: ${ |
| 354 | modules[0] |
| 355 | } and ${modules[1]}! ` + |
| 356 | `Please consider moving ${stringifyForError(type)} to a higher module that imports ${ |
| 357 | modules[0] |
| 358 | } and ${modules[1]}. ` + |
| 359 | `You can also create a new NgModule that exports and includes ${stringifyForError( |
| 360 | type, |
| 361 | )} then import that NgModule in ${modules[0]} and ${modules[1]}.`, |
| 362 | ); |
| 363 | } |
| 364 | } else { |
| 365 | // Mark type as having owner. |
| 366 | ownerNgModule.set(type, moduleType); |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | function verifyComponentIsPartOfNgModule(type: Type<any>) { |
| 371 | type = resolveForwardRef(type); |
no test coverage detected
searching dependent graphs…