uiGridValidateService.setValidator have newValue & oldValue param values reversed
#5,059 opened on Feb 3, 2016
Repository metrics
- Stars
- (5,395 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
I was testing the sample in Plunkr and printed the newValue and oldValue parameters. Their values have been reversed. "NewValue" is showing old value and vice versa. Below is documented function with 2 alert statements.
uiGridValidateService.setValidator('startWith', function(argument) { return function(newValue, oldValue, rowEntity, colDef) { if (!newValue) { return true; // We should not test for existence here } else { alert('newValue ' + newValue); alert('oldValue ' + oldValue); return newValue.startsWith(argument); } }; }, function(argument) { return 'You can only insert names starting with: "' + argument + '"'; }
);
- Nishat.