Created
June 1, 2021 22:00
-
-
Save enappd/0db15ace9e0af73a41f6d173cbec6a14 to your computer and use it in GitHub Desktop.
Ionic app PDF generation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { environment } from '../../environments/environment'; | |
import { InvoiceComponent } from '../components/invoice/invoice.component'; | |
import { ModalController } from '@ionic/angular'; | |
@Component({ | |
selector: 'app-home', | |
templateUrl: 'home.page.html', | |
styleUrls: ['home.page.scss'], | |
}) | |
export class HomePage { | |
public order = environment.orderData; | |
constructor(private modalCtrl: ModalController) { } | |
async openInvoice(order) { | |
const InvoiceModal = await this.createModal(InvoiceComponent, { order }); | |
await InvoiceModal.present(); | |
} | |
async createModal(component, componentProps?, cssClass?): Promise<HTMLIonModalElement> { | |
const modal = await this.modalCtrl.create({ | |
component, | |
cssClass, | |
componentProps, | |
backdropDismiss: true | |
}); | |
return modal; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment