fix(ivy): component destroy hook called twice when configured as provider (#28470)
Fixes the `ngOnDestroy` hook on a component or directive being called twice, if the type is also registered as a provider. This PR resolves FW-1010. PR Close #28470
This commit is contained in:

committed by
Igor Minar

parent
0ea216b993
commit
e1aaa7ec48
@ -467,6 +467,10 @@ export function isTypeProvider(value: SingleProvider): value is TypeProvider {
|
||||
return typeof value === 'function';
|
||||
}
|
||||
|
||||
export function isClassProvider(value: SingleProvider): value is ClassProvider {
|
||||
return !!(value as StaticClassProvider | ClassProvider).useClass;
|
||||
}
|
||||
|
||||
function hasDeps(value: ClassProvider | ConstructorProvider | StaticClassProvider):
|
||||
value is ClassProvider&{deps: any[]} {
|
||||
return !!(value as any).deps;
|
||||
|
Reference in New Issue
Block a user