This first image shows the local storage variables, specifically the scanned_code and outpan_item_name variables.
This second image shows how the entire process begins. The scan button is pressed, which invokes the barcode_scanner service.
This third image shows the mapping that occurs on success of the barcode scan. The text from the barcode scan is saved to the local storage "scanned_code"
This fourth image shows the setup of the barcode_search_outpan (which runs the api rest to outpan to scan the barcode. This is initiated on success of the barcode_scanner service after the barcode mapping.
This fifth image shows the mapping of the scanned_code to the api before the send.
This sixth image shows the mapping that occurs after the success of the api call. the name field from the api response is mapped to outpan_item_name local storage variable.
This last image shows the javascript that we have been discussing which is called after the success of the api call and after the previous mapping.