* Generates a helpful error message for the user when a pipe is not found. * * @param name Name of the missing pipe * @returns The error message
(name: string)
| 142 | * @returns The error message |
| 143 | */ |
| 144 | function getPipeNotFoundErrorMessage(name: string) { |
| 145 | const lView = getLView(); |
| 146 | const declarationLView = lView[DECLARATION_COMPONENT_VIEW] as LView<Type<unknown>>; |
| 147 | const context = declarationLView[CONTEXT]; |
| 148 | const hostIsStandalone = isHostComponentStandalone(lView); |
| 149 | const componentInfoMessage = context ? ` in the '${context.constructor.name}' component` : ''; |
| 150 | const verifyMessage = `Verify that it is ${ |
| 151 | hostIsStandalone |
| 152 | ? "included in the '@Component.imports' of this component" |
| 153 | : 'declared or imported in this module' |
| 154 | }`; |
| 155 | const errorMessage = `The pipe '${name}' could not be found${componentInfoMessage}. ${verifyMessage}`; |
| 156 | return errorMessage; |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * Invokes a pipe with 1 arguments. |
no test coverage detected
searching dependent graphs…