• Getting Started
  • Components
    • Barcodes
    • Buttons
    • Chartsupdated
    • Conversational UIupdated
    • Data Query
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Filter
    • Gantt
    • Gauges
    • Gridupdated
    • Icons
    • Indicators
    • Inputsupdated
    • Labels
    • Layout
    • ListBox
    • ListView
    • Map
    • Menus
    • Navigation
    • Notification
    • Pager
    • PDF Export
    • PDFViewer
    • PivotGrid
    • Popup
    • ProgressBars
    • Ripple
    • Schedulerupdated
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • ToolBar
    • Tooltips
    • TreeList
    • TreeView
    • Typography
    • Uploads
    • Utilities
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Sample Applications
  • FAQ
  • Troubleshooting
  • Updates
  • Changelogs
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?