Last active
March 16, 2016 10:57
-
-
Save jrabbit/b82c9bd271878cc98d26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<article> | |
<div id='yourElement'></div> | |
<ol id="isbnList"> | |
{%verbatim%} | |
<template id="t" is="dom-bind"> | |
<template is="dom-repeat" items="{{data}}"> | |
<div><span>{{item}}</span> </div> | |
</template> | |
</template> | |
{% endverbatim %} | |
</ol> | |
</article> | |
<script type="text/javascript"> | |
Quagga.init({ | |
inputStream : { | |
name : "Live", | |
type : "LiveStream", | |
target: document.querySelector('#yourElement') // Or '#yourElement' (optional) | |
}, | |
decoder : { | |
readers : ["ean_8_reader", "ean_reader"] | |
} | |
}, function(err) { | |
if (err) { | |
console.log(err); | |
return | |
} | |
console.log("Initialization finished. Ready to start"); | |
Quagga.onDetected(function(data){ | |
console.log(data.codeResult.code) | |
document.querySelector("#t").push('data', data.codeResult.code) | |
}) | |
document.querySelector("#t").data = [] | |
Quagga.start(); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment