Subhendu Kundu
Subhendu Kundu

Reputation: 3856

How to scan Qr-code in angular 2 application?

I am trying to create an application where it will scan a qr-code with angular-cli? I did found few npm modules like qrcode-reader. But any of them are working with angular 2. I guess, beacuse qrcode-reader more like nodejs server side module. Is there anyway to build the application?

Upvotes: 4

Views: 12209

Answers (3)

Isanka Thalagala
Isanka Thalagala

Reputation: 1721

Once I used @zxing/ngx-scanner and it worked fine. See demo here.

easy to use:

<!-- some.component.html -->
<zxing-scanner></zxing-scanner>

Install: npm i @zxing/ngx-scanner

Upvotes: 2

Jeremy Dowdall
Jeremy Dowdall

Reputation: 1274

I just installed angular2-qrscanner in a project and it seems to be working right out of the box. (it's only for Chrome, FF, and Opera though)

Github: https://github.com/tulkasEldarion/angular2-qrscanner

install: npm install angular2-qrscanner --save

use: <qr-scanner (onRead)="callback($event)"></qr-scanner>

Upvotes: 0

Stan Swiniarski
Stan Swiniarski

Reputation: 41

I am using barcodeScanner in ng-cordova to scan barcodes. I had to make code changes in ngCordova to make it work correctly with the barcodeScanner plugin (there are several versions of it out there), but it's working great now.

Upvotes: 0

Related Questions