You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone,
I have updated an Ember application from Ember 3.6 - Ember-CP 4.0.0-beta.5 to the versions listed above.
My application had the following validation code on a PromiseObject. The buildLogic() method was called from a property observer once a specific "logic" property was loaded on object creation.
varProduct=DS.PromiseObject.extend({buildLogic(content){letvalidations={};for(letpropertyofObject.keys(this.get('properties'))){/* Other code to set up validations... */validations[`codeParts.${property}`]=validator('codePart',{dependentKeys});}this.reopen(buildValidations(validations));}})
This code was correctly checking every product.${property} for validation, and the global validations.isValid was correctly set and observable.
I have moved the whole code in a new Component, as follows:
exportdefaultComponent.extend({didInsertElement(){this._super(...arguments);constvalidations={};for(letpropertyofObject.keys(this.properties)){/* Other code to set up validations... */validations[`codeParts.${property}`]=validator('codePart',{dependentKeys});}this.reopen(buildValidations(validations));}});
In this case, if I check validation for the single product.${property}, it works correctly, updating the property every time the observed value changes.
The global validations.isValid, though, is not accessible at all, neither in the component code (setting an observer on the validations.isValid) or by {{log this.validations.isValid}}.
Interestingly, if I {{log this}} on the component, the console will show an Ember object with validations property set, but if I {{log this.validations}} or if I {{log validations}}, it returns undefined.
Anyone knows what the reason may be?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Environment
Steps to Reproduce
Hi everyone,
I have updated an Ember application from Ember 3.6 - Ember-CP 4.0.0-beta.5 to the versions listed above.
My application had the following validation code on a PromiseObject. The
buildLogic()
method was called from a property observer once a specific "logic" property was loaded on object creation.This code was correctly checking every
product.${property}
for validation, and the globalvalidations.isValid
was correctly set and observable.I have moved the whole code in a new Component, as follows:
In this case, if I check validation for the single
product.${property}
, it works correctly, updating the property every time the observed value changes.The global
validations.isValid
, though, is not accessible at all, neither in the component code (setting an observer on thevalidations.isValid
) or by{{log this.validations.isValid}}
.Interestingly, if I
{{log this}}
on the component, the console will show an Ember object withvalidations
property set, but if I{{log this.validations}}
or if I{{log validations}}
, it returns undefined.Anyone knows what the reason may be?
Thanks in advance.
The text was updated successfully, but these errors were encountered: