We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I'm checking if any of properties in object contains '' (empty string) and i'm trying to override it with null value.
for (let key in row.currentData) { if ((!row.currentData[key]) || (row.currentData[key] && (row.currentData[key].toString().trim() === '') { row.currentData[key] = null; } }
but after all, when I debug row.currentData selected property still has value: '' instead of null. What's wrong?
The text was updated successfully, but these errors were encountered:
To update data, you should use the validator (if any) :
// Partial update: row.currentData = {key: value}; // Or equivalent row.validator.patchValue({key: value}); // Full update (all keys): row.validator.setValue(data);
This is because row.currentData can be a getter, when using reactive form validator. See https://github.com/irossimoline/angular4-material-table/blob/master/src/table-element-reactive-forms.ts#L13
Sorry, something went wrong.
No branches or pull requests
Hi,
I'm checking if any of properties in object contains '' (empty string) and i'm trying to override it with null value.
but after all, when I debug row.currentData selected property still has value: '' instead of null. What's wrong?
The text was updated successfully, but these errors were encountered: