angular-qr-scanner

0.1.5 • Public • Published

angular-qr-scanner

Angular directive for a QR Scanner. It is the angular version of html5-qrcode and uses jsqrcode.

Check out the live demo.

Usage

<qr-scanner ng-success="onSuccess(data)" width="400" height="300"></qr>

Install

$ bower install angular-qr-scanner

Example

<html ng-app="App">
<body ng-controller="qrCrtl">
<qr-scanner width="400" height="300" ng-success="onSuccess(data)" ng-error="onError(error)" />
 
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.js"></script>
<script src="bower_components/angular-qr-scanner/qr-scanner.js"></script>
<script src="bower_components/angular-qr-scanner/src/jsqrcode-combined.min.js"></script>
<script>
 
var App = angular.module('App', ['qrScanner']);
 
App.controller('qrCrtl', ['$scope', function($scope) {
    $scope.onSuccess = function(data) {
        console.log(data);
    };
    $scope.onError = function(error) {
        console.log(error);
    };
    $scope.onVideoError = function(error) {
        console.log(error);
    };
}]);
 
</script> 
</body>
</html>

License

The MIT License

Copyright (c) 2013-2015 Sembrestels

Dependencies (2)

Dev Dependencies (3)

Package Sidebar

Install

npm i angular-qr-scanner

Weekly Downloads

5

Version

0.1.5

License

none

Unpacked Size

141 kB

Total Files

9

Last publish

Collaborators

  • damianwajser