Back
Edit this post on GitHub
Written by Sandeep B on Sunday, October 6 2019
Generate QR code with Share / Download Feature ( Angular 8)
Angular Journey

Hey there,

Recently I had to generate QR code in my web application for a client. So I thought to share it here.
##Library Used Angular Material ngx-qrcode2
npm install ngx-qrcode2 --save
Now, the package will be installed in our application.
Go to the app.module.ts file add a reference there for the QR code package.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { NgxQRCodeModule } from 'ngx-qrcode2';
import { FormsModule } from '@angular/forms';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AppRoutingModule, NgxQRCodeModule, FormsModule],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
Open the app.component.html file and add the code in it.

Open the app.component.ts file and add the code in it.

Pass the string to "value" element to generate the QR code.
Thats it for now.
More in Angular Journey
- ⭐Angular 14 Features ⭐
- ⭐Angular 13 Features ⭐
- 🤷♂️ How to build and deploy angular application to surge using github actions
- Angular 11 Now Available
- How to filter the data with a common search bar at the top (Angular 8)
- Angular 10 Now Available
- Angular 12 features
- Angular : Dark Fate
- Angular 9 New Features (Finally IVY is here)

Sandeep B
Frontend engineer writing about Angular, JavaScript, and the occasional deep dive into whatever's currently breaking my build.