1.0.1 • Published 3 years ago

@just-so-so/ngx-qrcode v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

NgxQrCode

It is based on qrcode, you can use NgxQrCodePopoverDirective to show QrCode Popover on element, also you can use NgxQrCodeComponent as qrcode wrapper.

Please see demo.

Import:

    import { NgxQrcodeModule } from '@just-so-so/ngx-qrcode';

NgxQrCodePopoverDirective

    <span ngx-qrcode-popover [qrCodeOptions]="qrCodeOptions" [qrData]="'any text'" [direction]="'left'">

NgxQrCodeOptions

  export interface NgxQrCodeOptions {
        version?: number;
        errorCorrectionLevel?: QRCodeErrorCorrectionLevel;
        toSJISFunc?: (codePoint: string) => number;
        margin?: number;
        scale?: number;
        width?: number;
        color?: {
            dark?: string;
            light?: string;
        };
    }
PropertyDescription
qrCodeOptionsNgxQrCodeOptions
direction'top','right','bottom','left'
qrDataQR code content data
(onError)EventEmitter<Error>
(onSuccess)EventEmitter<HTMLCanvasElement>

NgxQrCodeComponent

    <ngx-qrcode [qrData]="'any text'"></ngx-qrcode>
PropertyDescription
versionsame with qrcode version
errorCorrectionLevelsame with qrcode errorCorrectionLevel
toSJISFuncsame with qrcode toSJISFunc
marginsame with qrcode margin
scalesame with qrcode scale
widthsame with qrcode width
colorDarksame with qrcode color.dark
colorLightsame with qrcode color.light
dataUrlTypesame with qrcode type, values are 'image/png' , 'image/jpeg' , 'image/webp'
rendererQualitysame with qrcode rendererOpts.quality
qrDataQR code content data
outputType'img','canvas','url'
(onError)EventEmitter<Error>
(onSuccess)EventEmitter<string,HTMLImageElement,HTMLCanvasElement>

NgxQrCodeService

MethodDescription
(toCanvas)toCanvas(qrData: any, qrOptions: NgxQrCodeOptions, element?: any): Promise<HTMLCanvasElement>
(toDataURL)toDataURL(qrData: any, qrOptions: NgxQrCodeToDataURLOptions, element?: any): Promise<string>