fix(ivy): NgOnChangesFeature no longer included in hello_world (#28187)
- Wraps the NgOnChangesFeature in a factory such that no side effects occur in the module root - Adds comments to ngInherit property on feature definition interface to help guide others not to make the same mistake - Updates compiler to generate the feature properly after the change to it being a factory - Updates appropriate tests PR Close #28187
This commit is contained in:

committed by
Alex Rickabaugh

parent
a95e81978b
commit
5430d2bc66
@ -125,7 +125,7 @@ function baseDirectiveFields(
|
||||
*/
|
||||
function addFeatures(
|
||||
definitionMap: DefinitionMap, meta: R3DirectiveMetadata | R3ComponentMetadata) {
|
||||
// e.g. `features: [NgOnChangesFeature]`
|
||||
// e.g. `features: [NgOnChangesFeature()]`
|
||||
const features: o.Expression[] = [];
|
||||
|
||||
const providers = meta.providers;
|
||||
@ -142,7 +142,7 @@ function addFeatures(
|
||||
features.push(o.importExpr(R3.InheritDefinitionFeature));
|
||||
}
|
||||
if (meta.lifecycle.usesOnChanges) {
|
||||
features.push(o.importExpr(R3.NgOnChangesFeature));
|
||||
features.push(o.importExpr(R3.NgOnChangesFeature).callFn(EMPTY_ARRAY));
|
||||
}
|
||||
if (features.length) {
|
||||
definitionMap.set('features', o.literalArr(features));
|
||||
|
Reference in New Issue
Block a user