Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Detects barcode or qr code scanning on document and emits the scanned code.

License

NotificationsYou must be signed in to change notification settings

sezmars/ngx-scan-detect

Repository files navigation

Demo |Video Demo

Detects barcode or qr code scanning on document and emits the scanned barcode.

NPM versionNPM monthly downloadsNPM total downloadsMade with Angular

This project was generated withAngular CLI version 16.2.2.

Development server

Runng serve for a dev server. Navigate tohttp://localhost:4200/. The app will automatically reload if you change any of the source files.

OR

Go tongx-scan-detect.

Code scaffolding

Runng generate component component-name to generate a new component. You can also useng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Runng build to build the project. The build artifacts will be stored in thedist/ directory. Use the--prod flag for a production build.

Running unit tests

Runng test to execute the unit tests viaKarma.

Running end-to-end tests

Runng e2e to execute the end-to-end tests viaProtractor.

Further help

To get more help on the Angular CLI useng help or go check out theAngular CLI README.

ngx-scan-detect

NPM

Demo

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

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

<inputngxBarCodePut(detected)="onDetected($event)">

Installation

npm install --save ngx-scan-detect

Usage

You can then use the directive in your templates:

@Component({selector:'app-ngx-scan-detect',templateUrl:'./ngx-scan-detect.component.html',styleUrls:['./ngx-scan-detect.component.scss'],standalone:true,imports:[CommonModule,NgxBarCodePutDirective],})exportclassAppComponent{publiconDetected(event:IDetect){console.info(event);/* {event: KeyboardEvent, value: "sezmars", time: 0.07083499999716878, type: "scanner"} *//* {event: KeyboardEvent, value: "3333333", time: 0.17083499999716878, type: "keyboard"} */}publiconDelete(event:IDelete){console.info(event);/* {event: KeyboardEvent, value: "3333333", type: "delete"} */}}

Options

Property nameTypeDefaultDescription
debouncenumber0This property is necessary for scenarios such as type-ahead where the rate of user input must be controlled.
workModestringmanualThis property controls the automatic clearing of the input field.
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.
detectedeventemptyReturns object with keyboard event, input value, data entry time and device type: keyboard or scanner.
deleteeventemptyReturns an object with input value, keyboard event, and type.

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp