(type: any)
| 230 | * scenario if we find the `ɵprov` on an ancestor only. |
| 231 | */ |
| 232 | export function getInheritedInjectableDef<T>(type: any): ɵɵInjectableDeclaration<T> | null { |
| 233 | // if the ɵprov prop exist but is undefined we still want to return null |
| 234 | const def = type?.[NG_PROV_DEF] ?? null; |
| 235 | |
| 236 | if (def) { |
| 237 | ngDevMode && |
| 238 | console.warn( |
| 239 | `DEPRECATED: DI is instantiating a token "${type.name}" that inherits its @Injectable decorator but does not provide one itself.\n` + |
| 240 | `This will become an error in a future version of Angular. Please add @Injectable() to the "${type.name}" class.`, |
| 241 | ); |
| 242 | return def; |
| 243 | } else { |
| 244 | return null; |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | /** |
| 249 | * Read the injector def type in a way which is immune to accidentally reading inherited value. |
no test coverage detected
searching dependent graphs…