Antonis Kountouretis February 2016

How can i change line between merge scopes?

$scope.message = $scope.share.Name_en.concat($scope.share.Address_en);
$scope.shareviasms = function() {

$cordovaSocialSharing.shareViaSMS($scope.message, null) 
}

The function work perfect and show the $scope.message which is merge with 2 scopes but i would like to change line or leave space between the $scope.share.Name_en and $scope.share.Address_en

Answers


Deblaton Jean-Philippe February 2016

You can use array.join :

$scope.message = [$scope.share.Name_en, $scope.share.Address_en].join(" ");

Or simply (as said by comments)

$scope.message = $scope.share.Name_en + ' ' + $scope.share.Address_en;

Post Status

Asked in February 2016
Viewed 2,793 times
Voted 12
Answered 1 times

Search




Leave an answer