IIRC, the cordova plugin creates a 'global' object cordova.plugin.barcodeScanner and the JS code has to call: cordova.plugin.barcodeScanner.xcan();
I think I could have just created a global function scan() in the package cordova.plugin.barcodeScanner, but it was useful to have a all-static Singleton with some private properties. For the ACE Editor, it looks like they also create a global "ace" object. HTH, -Alex On 12/28/17, 2:33 PM, "Olaf Krueger" <[email protected]> wrote: >Just for understanding: >Is there no need to instantiate a 'barcodeScanner' object here [1] cause >this class is marked as 'externs' (TypeDefs) and so it just calls some JS >functions? > >Thanks, >Olaf > >[1] >https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.co >m%2Fapache%2Froyale-tourjs%2Fblob%2Fdevelop%2Fcordova%2FBatchScanner%2FBat >chScanner%2Fsrc%2Fmain%2Fflex%2FBatchScanner.mxml%23L79&data=02%7C01%7Caha >rui%40adobe.com%7Cc426e00753b749ca0d6808d54e4305b8%7Cfa7b1b5a7b34438794aed >2c178decee1%7C0%7C0%7C636500972142334129&sdata=Oepk%2F8G0CCBbmbHcrceY5A8Ea >LRFsXjG6hAxyGE6VWs%3D&reserved=0 > > > >-- >Sent from: >https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-roy >ale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7Cc426e >00753b749ca0d6808d54e4305b8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6 >36500972142334129&sdata=%2FinDh8GFOzL2uzt9AWtlHlNKhxn54SmMjsArDpX1K%2F4%3D >&reserved=0
