Getting Started
    Components
    • Barcodes
    • Buttons
    • Charts
    • Conversational UI
    • Data Query
    • Date Inputs
    • Date Math
    • Dialogsupdated
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Filterupdated
    • Gantt
    • Gauges
    • Gridupdated
    • Icons
    • Indicatorsupdated
    • Inputsupdated
    • Labels
    • Layoutupdated
    • ListBox
    • ListView
    • Mapbeta
    • Menus
    • Navigation
    • Notification
    • Pager
    • PDF Export
    • PivotGridupdated
    • Popup
    • ProgressBarsupdated
    • Ripple
    • Schedulerupdated
    • ScrollView
    • Sortable
    • ToolBar
    • Tooltips
    • TreeList
    • TreeViewupdated
    • Typography
    • Uploads
    • Utilitiesnew
    Styling & Themes
    Common Features
    Project Setup
    Troubleshooting
New to Kendo UI for Angular? Start a free 30-day trial

createBarcodeValidator

Creates a value validator for a particular Barcode type.

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`.

In this article

Not finding the help you need?