# angular2-qrcode-generator

> An Angular 2 component that generates a QR Code.

Latest version **1.0.1** (published 2016-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install angular2-qrcode-generator
pnpm add angular2-qrcode-generator
yarn add angular2-qrcode-generator
bun add angular2-qrcode-generator
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-10-08 |
| First published | 2016-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | chris |
| Maintainers | wallaceiam |
| Keywords | qrcode, qr, code, angular2, angular, 2, ng2 |

## Links

- npm: https://www.npmjs.com/package/angular2-qrcode-generator
- Repository: https://github.com/wallaceiam/angular2-qrcode
- Homepage: https://github.com/wallaceiam/angular2-qrcode#readme
- Issues: https://github.com/wallaceiam/angular2-qrcode/issues
- npm.io page: https://npm.io/package/angular2-qrcode-generator

## Dependencies (2)

- [qrcodejs2](https://npm.io/package/qrcodejs2.md) 0.0.2
- [qrcode-generator](https://npm.io/package/qrcode-generator.md) ^1.0.0

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-10-08
- 1.0.0 — 2016-10-07

## README

[![npm version](https://badge.fury.io/js/angular2-qrcode.svg)](https://badge.fury.io/js/angular2-qrcode)
# angular2-qrcode
angular2-qrcode is a component that you can easily integrate into your project. It relies on [qrcode-generator](https://github.com/kazuhikoarase/qrcode-generator) to generate QR Codes.

## Install
    
    npm install angular2-qrcode

## How To Use

### RC5 UPDATE: Import into your NgModule and use it as Directive

```
import { NgModule } from '@angular/core';
import { QRCodeModule } from 'angular2-qrcode';

...

@NgModule({
    imports: [
        QRCodeModule,
        ...
    ]
})
```

In component template:
```
<div>
    <qr-code [data]="'All QR Code data goes here!'" [size]="150"></qr-code>
</div>
```

### Import the component and declare it as Directive

```
import {Component, OnInit} from '@angular/core';
import {QRCodeComponent} from 'angular2-qrcode';

@Component({
  selector: 'my-qr-code-component',
  directives: [QRCodeComponent],
  template: `
    <div>
      <qr-code [data]="'All QR Code data goes here!'" [size]="150"></qr-code>
    </div>
  `
})
```

## Parameters

| Attribute        | Type           | Default | Description  |
| ------------- |-------------| -----|------------|
| data      | String | '' | Your data string |
| size      | Number | 128     | This is the height/width of your QR Code component |
| level | String | 'M'    | QR Correction level ('L', 'M', 'Q', 'H') |
| type | Number | 4 | Buffer size for data string

## Note

If you have `code length overflow` errors, you need to increase the `[type]` value to increase the buffer for your data string.

## License
MIT License

---
_Source: https://npm.io/package/angular2-qrcode-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
