devgeeks / Canvas2ImagePlugin

PhoneGap / Cordova plugin for iOS to save the contents of an HTML canvas to the device's Photo Library
211 stars 218 forks source link

Ionic2 support #78

Open almgwary opened 7 years ago

almgwary commented 7 years ago

Is there any support for Ionic2 with typescript ?

almgwary commented 7 years ago

my current quick solution for Canvas2ImagePlugin typescript and Canvas2ImagePlugin ionic2 is and it is working successfully

let _widow:any = window ;

    if (_widow.cordova) {
      console.log('cordova attached');
      // running on device/emulator
      _widow.canvas2ImagePlugin.saveImageDataToLibrary(
        function(msg){
          console.log(msg);

        },
        function(err){
          console.log(err);

        },
        this.canvasAngularElementRef.nativeElement
      );
    }