     true
 
   #extract the collection name and id of the item
-  parseCode: (code) =>
+  parseCode: (code) ->
     parts = code.split(":")
     return {
       collection:parts[0]

    console.log "ERROR: #{errorMsg}"
    alert errorMsg

  openReader: =>
    if @notInApp()
      alert "This plugin is only supported in mobile apps."
    else if @pluginAvailable()
      cordova.plugins.barcodeScanner.scan @onScanResults, @onScanError
    else
      alert "Barcode Scanner Plugin not available!"

  setupButton: =>
    @onTap @btn, @openReader

    else
      @processScanResult result.text

  onScanError: (error) ->
    errorMsg = error
    if error == "unable to obtain video capture device input"
      errorMsg = "Could not access Camera. To fix this, switch to the Settings app, and go to:\n\n  Privacy > Camera\n\nThen, ensure the slider is enabled (green) for the Enterprise app."
