Reputation: 155
I have code like this:
$scope.viewOrderDetails = function viewOrderDetails(detail) {
var newWin = open('orderdetails.html','windowName','height=300,width=300');
newWin.document.write('html to write...');
newWin.document.write(detail);
//<input type="button" value="Close this window" onclick="self.close()">
}
I want to add close button to newWin. How can I achieve that? Thanks.
UPDATED:
newWin.document.write('<input type="button" value="Close this window" onclick="window.close()">');
it works in ionic serve
, but when running in my pad device, when i click "Close this window", the window can not be closed.
Upvotes: 3
Views: 893
Reputation: 127
The answer is in your question itself...you can try this...
newWin.document.write('<input type="button" value="Close this window" onclick="window.close()">');
Upvotes: 2