being a newbie to angular got stuck in copying json data, I need to copy my entire json object to clipboard , and then paste it later on. have done it through ngClip , but it dosen't copy the entire object else it copies the object name.below is what I've done so far:
<label>Copy #1</label>
<button class="btn btn-default" clip-copy="copy1">Copy!</button>
<script>
var myapp = angular.module('myapp', ["ngClipboard"]);
myapp.config(['ngClipProvider', function(ngClipProvider) {
ngClipProvider.setPath("//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/2.1.6/ZeroClipboard.swf");
}]);
myapp.controller('myctrl', function($scope) {
$scope.copy1 = {};
$scope.copy1.Name = "ABC";
$scope.copy1.age = 24;
$scope.copy1.City = "Pittsburgh";
});
</script>
Clicking on Copy! button always copies copy1, I want it to copy the entire object.However if I give copy1.Name in clip-copy it copies ABC. Any leads wud be appreciated.