I previously inquired about this issue and received a suggestion to add a service, but it did not solve the problem. I am trying to access a variable from a controller ($scope) within an external function. Below is a snippet of the example:
app.controller('formContratCtrl', function ($scope, $location, $rootScope,$cordovaFile, $cordovaGeolocation, $cordovaCamera) {
"$scope.owner={
"first":"john",
"last":"kennedy",
"phone":"",
"car":"",
"registration":"",
"dateRegistration":"
};
var JutoPDFCreator = {
createPDF: function(filename) {
var doc = new jsPDF();
doc.text(13, 20, 'First Name : '+ $scope.owner.first);
doc.text(13, 25, 'Last Name : '+ $scope.owner.last);
doc.text(13, 30, 'Phone : '+ owner.phone);
doc.text(13, 35, 'Rented Vehicle : '+ owner.car);
doc.text(13, 40, 'Registered : '+ owner.registration);
doc.text(13, 45, 'Since : '+ owner.dateRegistration);
.
.
}