I am binding the data to html table by using angularjs functionality in separate .js file. Where as I want to copy these bounded text data and paste it to any text document by clicking the input button below.
<button type="button" class="btn" ng-click="selectElementContents();"></button>
and in angular controller written function as below..
$scope.selectElementContents = function () {
copyTblData();
}
function copyTblData() {
var copyText = document.getElementById('tablerecords');
$('#tablerecords').focus();
$('#tablerecords').select();
document.execCommand('copy');
}
where I am doing mistake not understandable, required suggestion is appreciated.