title: how to add authentication header to $window.open
body: <p>I have angularjs application where users enter data that is saved to database, then on server side it is compiled into pdf file. All access requires appropriate authentication headers in place. After needed data is filled a user presses button to save data and then to retrieve pdf file. Optimally, I call <code>$window.open(url_generating_pdf</code>) in my angularjs app. This works well and opens in another window, but how to add authentication header to this <code>$window</code> request? In my understanding I cannot download pdf, and print it with ajax, so I am missing this authentication. Or would there be other ways to call url from server, and make the file open in another window?</p>