Angularjs + ionic + 'h5 + 'implements QR code scanning. angularjsionic
I would like to share with you todayAngularjs and ionicThe Framework supports QR code scanning on mobile phones. Cordova and Other plug-ins are not used, implemented by h5 +.
Development Tool: hbuilder
First, you need to introduce the "Barcode" configuration in the configuration file under the hbuilder project. The specific steps are as follows:
1. Find the "manifest. json" file, right-click it, and switch to the Code to try
2. In it, you can see "permissions" and directly add
"Barcode ":{
"Description": "QR code scanning"
. The image below is for your reference ,,
Second, let's talk a little bit about the code.
The area shown in the QR code is circled in red. This is the page code. Below is the js Code.
What I circled was a key part. I had a detailed explanation on the official website, so there were not many bits here. Remember, before executing this js, you must determine the mobile device; otherwise, an error will be reported during browser debugging.
Last, official website address: http://www.html5plus.org/doc/zh_cn/barcode.html