ngx-scanner-qrcode
This library is built to provide a solution scanner QR code.
This library takes in raw images and will locate, extract and parse any QR code found within.
This demo stackblitz.
Installation
Install ngx-scanner-qrcode
from npm
:
npm install ngx-scanner-qrcode --save
Add wanted package to NgModule imports:
import { NgxScannerQrcodeModule } from 'ngx-scanner-qrcode';
@NgModule({
imports: [
NgxScannerQrcodeModule,
]
})
In the Component:
<ngx-scanner-qrcode #action="scanner" [height]="200" [width]="300" (data)="output = $event"></ngx-scanner-qrcode>
<button (click)="action.start()">Start</button>
<button (click)="action.stop()">Stop</button>
<span>{{output}}</span>
API Documentation
Input
Field | Description | Type | Default |
---|
height | height of canvas | number | 300 |
width | width of canvas | number | 400 |
line | line frame qrcode | number | 3 |
color | color of line | string | #008000 |
Ouput
Field | Description | Type | Default |
---|
data | data of qrcode | string | null |
message | detected | string | null |
loading | Loading video | boolean | null |
Function
Field | Description | Type | Default |
---|
start | Active camera | function | null |
stop | Inactive camera | function | null |
Support versions Angular >= 8.0.3
Author: DaiDH
, Tel: 0845882882
License
MIT License. Copyright (c) 2021 DaiDH