Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

594
Vistas
Error while downloading features on qr-code generated using angularx-qrcode?

I used angularx-qrcode to generate a qrcode where it populates data from qrInfo. However I am getting this error:

ERROR TypeError: Cannot read properties of undefined (reading 'qrcElement') The code on qr-code-generate.component.html looks like:

<qrcode *ngIf="qrInfo" cssClass="coolQRCode" #qrcode [qrdata]="qrInfo" [width]="256" elementType="img" [errorCorrectionLevel]="'M'"></qrcode><a [href]="link" download><button class="btn btn-block (click)="downloadQRCode()">Download QRCode</button></a>

Whereas the code on the controller qr-code-generate.component.ts looks:

link: string;
 @ViewChild('qrcode', { static: true }) qrcode: QRCodeComponent;

  qrInfo : any;

Back to the *.component.ts file we handle the downloadQRCode() function as follows:

downloadQRCode() {this.link = this.qrcode.qrcElement.nativeElement.firstChild.src}

I can not download the img using the reference to the qrcode element we can access it's firstChild. And when I remove *ngIf="qrInfo" from ***.component.html I am receiving an error

angularx-qrcode.mjs:165 [angularx-qrcode] Error generating QR Code: angularx-qrcode] Field `qrdata` is empty, set allowEmptyString="true"' to overwrite this behaviour.
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

guzmanoj already helped out with the original issue, just as a future reference for other users, the lib angularx-qrcode has an issue where we track solutions how to download a qrcode

I think I should implement the download feature in the demo app

HTH

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda