I am using the @ionic-native/printer
module to print a specific area.
Here is the code of the print button:
print() {
this.platform.ready().then(success => {
this.printer.check().then(data => {
this.toastCtr.create({
message: data
});
}, error => {
this.toastCtr.create({
message: error,
closeButtonText: 'Ok'
}).present();
});
},
error => {
this.toastCtr.create({
message: error
}).present();
});
}
And the button html:
<button ion-button color="secondary" (click)="print()">PRINT THIS OFFER</button>
The module is imported in app.module.ts
and in home.ts
where it's used.
When I click on the print button, I get the following error:
cordova_not_available
But cordova is already installed.