Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/armanfatahi/ngx-qr

Angular 8 qr scanner
https://github.com/armanfatahi/ngx-qr

Last synced: 3 months ago
JSON representation

Angular 8 qr scanner

Awesome Lists containing this project

README

        

# ngx-qr
QrScanner will scan for a QRCode from your Web-cam and return its string.

### usage
```bash
$ npm install --save ngx-qr
```

```typescript
// app.module.ts
import { NgQrScannerModule } from 'ngx-qr';
@NgModule({
// ...
imports: [
// ...
NgQrScannerModule,
],
// ...
})
export class AppModule { }
```

```html

```

```typescript
// app.component.ts
import { Component, OnInit, AfterViewInit } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent implements OnInit, AfterViewInit {

ngOnInit() {
}

capturedQr(result: string) {
console.log(result);
}

ngAfterViewInit() {
}
}

```

#### Translation

Provide the following texts:

```ts
export interface QrScannerTexts {
NotSupportedHTML: string;
DeviceDefaultPrefix: string;
StopCameraText: string;
OpenButtonText: string;
}
```

```html

outdated browser.`,
DeviceDefaultPrefix: `Camera`,
StopCameraText: `Stop Camera`,
OpenButtonText: `Open QR Code File...` }">

```

#### Styling

Button styles can be changed:

```html

```
#### Upload QR Feature

You can let users upload a QR code using:

```html

```
If you only need upload QR feature, you can use the following:

```html

```

#### Error handling

Errors are shown on the error output:

```html

```