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

createBarcodeValidator

Creates a value validator for a particular Barcode type.

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'
//   }
// }

Parameters

type

BarcodeType

The type of the Barcode.
size?

Size

The size of the barcode, excluding the text label, padding and border. Optional.

Returns

ValidatorFn

A validator function that returns an error map with the `barcode` property if the validation check fails, otherwise `null`.
Not finding the help you need?
Contact Support