New to Kendo UI for AngularStart a free 30-day trial

Definition

Package:@progress/kendo-angular-barcodes

Syntax:

TS
const control = new FormControl('1234', createBarcodeValidator('EAN8'));
console.log(control.errors);
// {
//   barcode: {
//     message: 'The value of the "EAN13" encoding should be 12 symbols',
//     value: '1234',
//     type: 'EAN13'
//   }
// }

Creates a validator for a specific Barcode type.

Use this function to validate a Barcode value for a given BarcodeType.

Parameters:typeBarcodeType

Specifies the type of the Barcode.

size?Size

Specifies the size of the barcode, excluding the text label, padding, and border. This parameter is optional.

Returns:

ValidatorFn

Returns a validator function. The function returns an error map with the barcode property if validation fails. Otherwise, it returns null if valid.

Example:
TS
const control = new FormControl('1234', createBarcodeValidator('EAN8'));
console.log(control.errors);
// {
//   barcode: {
//     message: 'The value of the "EAN13" encoding should be 12 symbols',
//     value: '1234',
//     type: 'EAN13'
//   }
// }
In this article
Definition
Not finding the help you need?
Contact Support