Linked Questions

Popular Questions

Ionic how to get a Promise Reponse from a provider?

Asked by At

So I'm trying to get a response from a Promise in a Provider but I'm not having much luck.

My component never receives a response,

this.printerService.print(template).then(

            response => {

              console.log(response);

            }, err => {

             console.log(err);
        });

whilst my provider is returning true,

print(template): Promise<any> {
  return window.cordova.plugin.zebraprinter.print(address, join,
        function(success) { 

         return true;

        }, function(fail) { 

          return false;
        }
      );
}

Related Questions