Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngx-barcodeput

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-barcodeput

This package helps determine input using a barcode-scanner.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
156
decreased by-42.86%
Maintainers
1
Weekly downloads
 
Created
Source

ngx-barcodeput

NPM

Demo

Formerly called ngx-barcodeput

Angular directive for handling input events. Useful for determine input using a barcode-scanner.

Like binding to a regular type event in a template, you can do something like this:

<input ngxBarCodePut
       (onDetected)="onDetected($event)">

Installation

npm install --save ngx-barcodeput

Usage

Add NgxBarCodePutModule to your list of module imports:

import { NgxBarCodePutModule } from 'ngx-barcodeput';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, FormsModule, NgxBarCodePutModule],
  bootstrap: [AppComponent]
})
class AppModule {}

You can then use the directive in your templates:

@Component({
  selector: 'app',
  template: `
    <input type="text"
       ngxBarCodePut
       maxlength="14"
       [debounce]="300"
       autocomplete="off"
       [skipStartLength]="5"
       (onDetected)="onDetected($event)"
       (onBackspace)="onBackspace($event)">
       `
})

export class AppComponent {
  public onDetected(event: IDetect) {
    console.log(event.type, event.time, event.value);
  }

  public onBackspace(event: IBackspace) {
    console.log(event.code, event.keyName, event.value);
  }
}

Options

Property nameTypeDefaultDescription
debouncenumber0This property is necessary for scenarios such as type-ahead where the rate of user input must be controlled.
skipStartnumber0Allows you to ignore the first values of the length of the input data. The search begins after entering the first character if the value is 0.
onDetectedeventemptyReturns object with input value, data entry time and device type: keyboard, scanner or enter key.
onBackspaceeventemptyReturns the object with input value, the code and name of the backspace key.

Keywords

FAQs

Package last updated on 13 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc