How to call a scope variable from a Javascript Angular Service

Hi,
I created a Javascript Angular Service that is using the Barcodescanner plugin to generate a QR Code. So far, the service is working, but I need the encoded value to change depending on what is entered in an input field on the page.

So, I named the input field "value_to_encode" and mapped it via ng-model to a scope variable called "value_to_encode". Now I need to add the variable on the Javascript code.

This is the Javascript Angular Service code. The part I'm missing is where it says "NEED VALUE FROM SCOPE VARIABLE value_to_encode". I can generate the QR Code from this but I need the qrValue to come from the scope's "value_to_encode":

/**
* Service constructor function.
* The first service call to this function will be invoked
* as "new Func" and object will be returned.
* All subsequent service calls will return the same cached object.
* Read more at https://docs.angularjs.org/guide/providers#service-recipe
* Inject and use this service in scope method as following:
* var serviceInstance = Apperyio.get("serviceName");
*/
function Func( Apperyio ){