mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(core): Check for ngMetadataName instead of instanceof. Wiz doesn't extend InjectionToken. (#60572)
In cases such as Wiz, we avoid using the InjectionToken class since it comes from @angular/core. PR Close #60572
This commit is contained in:
@@ -681,7 +681,8 @@ function hasOnDestroy(value: any): value is OnDestroy {
|
||||
|
||||
function couldBeInjectableType(value: any): value is ProviderToken<any> {
|
||||
return (
|
||||
typeof value === 'function' || (typeof value === 'object' && value instanceof InjectionToken)
|
||||
typeof value === 'function' ||
|
||||
(typeof value === 'object' && value.ngMetadataName === 'InjectionToken')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user