AUR4105
Last updated
Was this helpful?
Was this helpful?
// ✅ Correct: Register custom rules first
import { ValidationRules } from '@aurelia/validation';
// Register custom rule
ValidationRules.customRule(
'isPositiveInteger',
(value) => value > 0 && Number.isInteger(value),
'Value must be a positive integer'
);
// Now the rule can be hydrated
validationRules.hydrateRules(rules);