NgValidationError
상수
안정화v22.0부터
The base class for all built-in, non-custom errors. This class can be used to check if an error is one of the standard kinds, allowing you to switch on the kind to further narrow the type.
사용 시 참고사항
const f = form(...);
for (const e of form().errors()) {
if (e instanceof NgValidationError) {
switch(e.kind) {
case 'required':
console.log('This is required!');
break;
case 'min':
console.log(`Must be at least ${e.min}`);
break;
...
}
}
}
상세 내용으로 이동