You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
I'm using cordova-sunmi-inner-print for printing sunmi v1 thermal printer device. More predefined functions here like printerStatusStartListener(), printerInit(),printstring() and so on. My doubt is globally defined variable not using inside predefined function like printerStatusStartListener().
Not alert any messages call and inside printerStatusStartListener() isPrinterValid variable type is 'any'. But, outside function check type is 'boolean'.
So, please suggest how to use global variable inside sunmi-inner-printer function or suggest any other ways
my code is here,
declare var sunmiInnerPrinter: any;
public isPrinterValid:boolean = true; // globally assign true
sunmiInnerPrinter.printerStatusStartListener(function (onSuccess) {
alert("On Success : "+ JSON.stringify(onSuccess))
if (onSuccess != undefined && onSuccess.action == PrinterConstants.NORMAL_ACTION) {
alert("success")
this.isPrinterValid = true; // condition is valid update 'true'
alert("success Value :"+this.isPrinterValid) // not calling alert
}
else {
alert("failure");
this.isPrinterValid = false; // condition is false, update 'false'
alert("failure Value :"+this.isPrinterValid) // not calling alert
}
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm using cordova-sunmi-inner-print for printing sunmi v1 thermal printer device. More predefined functions here like printerStatusStartListener(), printerInit(),printstring() and so on. My doubt is globally defined variable not using inside predefined function like printerStatusStartListener().
Not alert any messages call and inside printerStatusStartListener() isPrinterValid variable type is 'any'. But, outside function check type is 'boolean'.
So, please suggest how to use global variable inside sunmi-inner-printer function or suggest any other ways
my code is here,
declare var sunmiInnerPrinter: any;
public isPrinterValid:boolean = true; // globally assign true
sunmiInnerPrinter.printerStatusStartListener(function (onSuccess) {
alert("On Success : "+ JSON.stringify(onSuccess))
if (onSuccess != undefined && onSuccess.action == PrinterConstants.NORMAL_ACTION) {
alert("success")
this.isPrinterValid = true; // condition is valid update 'true'
alert("success Value :"+this.isPrinterValid) // not calling alert
}
else {
alert("failure");
this.isPrinterValid = false; // condition is false, update 'false'
alert("failure Value :"+this.isPrinterValid) // not calling alert
}
}
The text was updated successfully, but these errors were encountered: