ng-barcode-detector
v0.0.18
Published
A library using the Barcode Detection API implemented in Chrome 83.
Downloads
14
Maintainers
Readme
ng-barcode-detector
A library using the Barcode Detection API implemented in Chrome 83.
The Barcode Detection API is a subset of the Shape Detection API which provides the ability to detect and decode barcodes in an image provided by script. The image may come from any type of image buffer source such as an image, video or canvas tag.
Some native platforms include built-in libraries for performing text detection and optical character recognition (OCR) in images. The availability of these libraries means that developers do not need to include a large third party library.
Installation
npm install --save ng-barcode-detector
Usage
import { NgBarcodeDetectorModule } from 'ng-barcode-detector';
@NgModule({
imports: [NgBarcodeDetectorModule],
})
export class AppModule {}
<ng-barcode-detector (detect)="onDetect($event)"></ng-barcode-detector>
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
public onDetect(result: string): void {
alert(result);
}
}