fix(ivy): ngOnChanges should be inherited from super class (#28563)
PR Close #28563
This commit is contained in:
@ -12,6 +12,7 @@ import {fillProperties} from '../../util/property';
|
||||
import {EMPTY_ARRAY, EMPTY_OBJ} from '../empty';
|
||||
import {ComponentDef, DirectiveDef, DirectiveDefFeature, RenderFlags} from '../interfaces/definition';
|
||||
|
||||
import {NgOnChangesFeature} from './ng_onchanges_feature';
|
||||
|
||||
|
||||
/**
|
||||
@ -168,6 +169,10 @@ export function InheritDefinitionFeature(definition: DirectiveDef<any>| Componen
|
||||
definition.doCheck = definition.doCheck || superPrototype.ngDoCheck;
|
||||
definition.onDestroy = definition.onDestroy || superPrototype.ngOnDestroy;
|
||||
definition.onInit = definition.onInit || superPrototype.ngOnInit;
|
||||
|
||||
if (superPrototype.ngOnChanges) {
|
||||
NgOnChangesFeature()(definition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -151,9 +151,7 @@ function directiveMetadata(type: Type<any>, metadata: Directive): R3DirectiveMet
|
||||
inputs: metadata.inputs || EMPTY_ARRAY,
|
||||
outputs: metadata.outputs || EMPTY_ARRAY,
|
||||
queries: extractQueriesMetadata(type, propMetadata, isContentQuery),
|
||||
lifecycle: {
|
||||
usesOnChanges: type.prototype.ngOnChanges !== undefined,
|
||||
},
|
||||
lifecycle: {usesOnChanges: type.prototype.hasOwnProperty('ngOnChanges')},
|
||||
typeSourceSpan: null !,
|
||||
usesInheritance: !extendsDirectlyFromObject(type),
|
||||
exportAs: extractExportAs(metadata.exportAs),
|
||||
|
Reference in New Issue
Block a user