Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set barcodeType or Max Length #5

Open
TriumphTruth opened this issue Feb 14, 2020 · 3 comments
Open

Cannot set barcodeType or Max Length #5

TriumphTruth opened this issue Feb 14, 2020 · 3 comments

Comments

@TriumphTruth
Copy link

Hello Everybody... I am trying to integrate the barcode scanner but somehow it is stuck with 'ean12' type. I have tried to do everything I could understand but no luck. I will describe the issue below and what I have tried and let me know what I am missing.

Modal which is having the scanning component

<div class="modal-body">
            <ngx-sw-scanner-detection
            (scan)="barcodeScanned($event)"
            [config]="{scannerEndsWith: 'Enter'}"
            >
          </ngx-sw-scanner-detection>
           <!-- <input type="text" #barcode ngbAutofocus (keydown)="barcodeScanned($event)"> -->
	<img src="assets/media/modals/scanner.png" class="img-fluid mx-auto d-block" />
</div>

This configuration results in the following response in my handler:

barcode: "295642975221"
length: 12
valid: false
__proto__: Object

If I change the configuration to:

<div class="modal-body">
            <ngx-sw-scanner-detection
            (scan)="barcodeScanned($event)"
            [config]="{scannerEndsWith: 'Enter', barcodeType: 'ean14', maxLength: 14}"
            >
          </ngx-sw-scanner-detection>
           <!-- <input type="text" #barcode ngbAutofocus (keydown)="barcodeScanned($event)"> -->
	<img src="assets/media/modals/scanner.png" class="img-fluid mx-auto d-block" />
</div>

Nothing happens....

I even went and hardcoded the type in the library's config model instead of 'ean13' but still it doesn't pick 14 characters. It will always pick 12 characters.

Please let me know what wrong I am doing. I am badly stuck right now. Thank you.

@TriumphTruth
Copy link
Author

Anyone who can help me on this?

@TriumphTruth
Copy link
Author

@baao sir can you help me on this? This library picks up the scanner just fine. Its just the character reading which is a problem with me. Since you built it you must be able to help me on this note.

@MeeranRM
Copy link

Same issue for me too. Please provide us a solution

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants