angular-qr

WebJar for angular-qr

License

License

MIT
Categories

Categories

Angular User Interface Web Frameworks
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

angular-qr
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

angular-qr
WebJar for angular-qr
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/janantala/angular-qr

Download angular-qr

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-qr/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-qr</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-qr/
implementation 'org.webjars.bower:angular-qr:0.2.0'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-qr/
implementation ("org.webjars.bower:angular-qr:0.2.0")
'org.webjars.bower:angular-qr:jar:0.2.0'
<dependency org="org.webjars.bower" name="angular-qr" rev="0.2.0">
  <artifact name="angular-qr" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-qr', version='0.2.0')
)
libraryDependencies += "org.webjars.bower" % "angular-qr" % "0.2.0"
[org.webjars.bower/angular-qr "0.2.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.bower : angular jar [1.2.5,1.3)
org.webjars.bower : qrcode jar [1.0.0,2)

Project Modules

There are no modules declared in this project.

angular-qr v0.2.0 Build Status

QR code generator for AngularJS

Demo

Check out http://janantala.github.io/angular-qr/demo/

Requirements

  • AngularJS v 1.0+
  • qrcode.js (bower install qrcode is installed with angular-qr as dependecy)

Usage

We use bower for dependency management. Add

dependencies: {
    "angular-qr": "latest"
}

To your bower.json file. Then run

bower install

This will copy the angular-qr files into your bower_components folder, along with its dependencies. Load the script files in your application:

<script type="text/javascript" src="bower_components/angular/angular.js"></script>
<script type="text/javascript" src="bower_components/qrcode/lib/qrcode.min.js"></script>
<script type="text/javascript" src="bower_components/angular-qr/angular-qr.min.js"></script>

Add the ja.qr module as a dependency to your application module:

var myAppModule = angular.module('MyApp', ['ja.qr']);

Directive

$scope.string = 'YOUR TEXT TO ENCODE';
<qr text="string"></qr>
<qr type-number="8" correction-level="'M'" size="200" input-mode="'ALPHA_NUM'" text="string" image="true"></qr>

Required attributes

text

Your text to encode from variable in the scope. If you want to encode text directly you need to escape it text="'YOUR TEXT TO ENCODE'".

Optional attributes

type-number

  • 1-40
  • default value: 0 = minimal required version

correction-level

  • L - Low
  • M - Medium (default)
  • Q - Quartile
  • H - High

size

Size in pixels

  • default value: 250

input-mode

  • NUMBER: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  • ALPHA_NUM: *0–9, A–Z (upper-case only), space, $, %, , +, -, ., /, :
  • 8bit: ISO 8859-1
  • default value: minimal required input mode based on input text

image

  • If you want to render qr code into image element set this attribute to true.

Contributing

Contributions are welcome. Please make a pull request against canary branch, use Git Commit Message Conventions and do not bump versions. Also include tests.

Testing

We use karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use gulp:

npm install -g gulp
npm install
bower install
gulp

The karma task will try to open Chrome as a browser in which to run the tests. Make sure this is available or change the configuration in karma.conf.js

License

The MIT License

Copyright (c) 2014 Jan Antala

Versions

Version
0.2.0