angularjs - 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 , show $scope.message merge 2 scopes change line or leave space between $scope.share.name_en , $scope.share.address_en

you can use array.join :

$scope.message = [$scope.share.name_en, $scope.share.address_en].join(" "); 

or (as said comments)

$scope.message = $scope.share.name_en + ' ' + $scope.share.address_en; 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -