REACT
$state.saveData= function(productfilter){
var url = CONFIG.apiUrl + '/product';
window.open(url);
window.print(url);
};
CSS
<button onClick="saveData(productfilter)" type="button">Print</button>
I want to use window.print() with JSON data fetched from an API. How can I accomplish this?