Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(core): remove v10 mention from @Injectable warning #37383

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/core/src/di/interface/defs.ts
Expand Up @@ -217,8 +217,8 @@ function getOwnDefinition<T>(type: any, def: ɵɵInjectableDef<T>): ɵɵInjectab
*
* @param type A type which may have `ɵprov`, via inheritance.
*
* @deprecated Will be removed in v10, where an error will occur in the scenario if we find the
* `ɵprov` on an ancestor only.
* @deprecated Will be removed in a future version of Angular, where an error will occur in the
* scenario if we find the `ɵprov` on an ancestor only.
*/
export function getInheritedInjectableDef<T>(type: any): ɵɵInjectableDef<T>|null {
// See `jit/injectable.ts#compileInjectable` for context on NG_PROV_DEF_FALLBACK.
Expand All @@ -233,7 +233,8 @@ export function getInheritedInjectableDef<T>(type: any): ɵɵInjectableDef<T>|nu
console.warn(
`DEPRECATED: DI is instantiating a token "${
typeName}" that inherits its @Injectable decorator but does not provide one itself.\n` +
`This will become an error in v10. Please add @Injectable() to the "${typeName}" class.`);
`This will become an error in a future version of Angular. Please add @Injectable() to the "${
typeName}" class.`);
return def;
} else {
return null;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/di/jit/injectable.ts
Expand Up @@ -46,7 +46,7 @@ export function compileInjectable(type: Type<any>, srcMeta?: Injectable): void {
// undecorated parent class. We work around it by defining a method which should be used
// as a fallback. This should only be a problem in JIT mode, because in AOT TypeScript
// seems to have a workaround for static properties. When inheriting from an undecorated
// parent is no longer supported in v10, this can safely be removed.
// parent is no longer supported (v11 or later), this can safely be removed.
if (!type.hasOwnProperty(NG_PROV_DEF_FALLBACK)) {
(type as any)[NG_PROV_DEF_FALLBACK] = () => (type as any)[NG_PROV_DEF];
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/acceptance/di_spec.ts
Expand Up @@ -1030,7 +1030,7 @@ describe('di', () => {
if (ivyEnabled) {
expect(warnSpy).toHaveBeenCalledWith(
`DEPRECATED: DI is instantiating a token "SubSubClass" that inherits its @Injectable decorator but does not provide one itself.\n` +
`This will become an error in v10. Please add @Injectable() to the "SubSubClass" class.`);
`This will become an error in a future version of Angular. Please add @Injectable() to the "SubSubClass" class.`);
}
});

Expand Down Expand Up @@ -1061,7 +1061,7 @@ describe('di', () => {
if (ivyEnabled) {
expect(warnSpy).toHaveBeenCalledWith(
`DEPRECATED: DI is instantiating a token "MyRootService" that inherits its @Injectable decorator but does not provide one itself.\n` +
`This will become an error in v10. Please add @Injectable() to the "MyRootService" class.`);
`This will become an error in a future version of Angular. Please add @Injectable() to the "MyRootService" class.`);
}
});

Expand Down