1
我有一个服务调用了JSON响应,我想将此JSON响应复制到新窗口中的textarea。有没有办法在AngularJS中做到这一点?AngularJS - 在新窗口中将JSON文本复制到textarea
我有什么至今:
GetData.getJson(item).then(function(returnValues){
var data = returnValues[0].data; // a json object as a string, ideally I would like to pretty print this in the new window.
// need to create text area in the new window so I can paste the text in
$window.open("data:text/html,"+ encodeURIComponent(data), "_blank", "width=800,height=600");
}