How do I copy a string value's text to the user's clipboard?

Hey there,

I am very new coding on Appery.io and for mobile phones in general, so I apologize if the answer is obvious. I attained longitude and latitude values from Google maps in the below code, and combined those numbers to make a valid link.

My question how do I code a button to copy the text from $google_l to the user's clipboard after they tap it (so they can paste it into a text message.)

Note that "google_link" is a combination of template text and two values, longitude and latitude.

var requestData = {};

// read more about using rest services: https://links.appery.io/ve-snippet-rest
Apperyio.get("Geolocation_currentPosition")(requestData).then(
function(success){ // success callback
(function mapping5252(success, $scope){
var la_scope = $scope.la;
var lo_scope = $scope.lo;
la_scope = success.coords.latitude;
lo_scope = success.coords.longitude;
$scope.la = la_scope;
$scope.lo = lo_scope;
var google_link = "https://www.google.com/maps/search/?a...=" + $scope.la + "," + $scope.lo;
$google_l = google_link;

})(success, $scope);

},
function(error){ // callback to handle request error

},
function(notify){ // notify callback, can fire few times

});
1 person has
this question
+1
Reply