Closed bm2112 closed 6 years ago
Well, there's no way I know if you're doing it right you know? That's why we ask for a StackBlitz like example, so we can debug your code and find out what's wrong. Can you provide one?
This is my first time working with AngularJS but when I posted this I was just trying to change the code in app.component.ts and then run the application. I realized that I needed to rebuild the bundles with the new code, so I did an "ng build --prod", but now I am getting this error when running the site from IIS: "ERROR TypeError: "e.map is not a function".
I have the main bundle and the app.component.ts file in this StackBlitz if you'd like to look at it: https://stackblitz.com/edit/angular-fewsox
All I want to do with the original code you have, is add the line: window.location.href = 'http://localhost:58430/docs/DBConnect.aspx?result=' + resultString; in the handleQrCodeResult function. What is the right way to do this?
Thanks
I figured it out on my own. I just added that line in the main bundle after I did a ctrl-F for "handleQrCodeResult" since I couldn't get it to build without errors.
I see, did you install @zxing/ngx-scanner
throught npm
?
Yes, I did. I'm currently just editing the main bundle to suit my application's needs right now, and I realize there has to be a much easier way.
Sorry, I'm a little confuded here. 😅
Our first time with Angular is always a little mess, so don't worry about any strange thing happening.
You can still get in touch with us for solving errors, we help as much as we can, feel free to join our Gitter chat.
Cya.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Describe the bug I'm integrating this website into an ASP.NET project I am working on and I am trying to redirect to another url when a scan is successful. I added a couple lines of code to the handleQrCodeResult method, and I have a breakpoint there in VS 2017. However, even when the scan is successful the method is not called. I haven't changed any of the code in app.component.html. I am depending on the (scanSuccess) method shown here.
<zxing-scanner #scanner start="true" [device]="currentDevice" (scanSuccess)="handleQrCodeResult($event)" formats="['CODE_39', 'CODE_128', 'QR_CODE']">
Expected behavior I expected it to execute the handleQrCodeResult function in app.component.ts.
Desktop (please complete the following information): IIS Express (debugging in Visual Studio 2017)