Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get header of existing page in angularjs

Is there a way to get the header of the current page in angularjs, without having to do a separate call? I can't find this in the docs anywhere, but it seems like it should be possible.

E.g. if the file index.html contains the angular code, how do I read the header of the initial request to get index.html? I could use $http to make the call again, but that seems unnecessary.

like image 642
Tyler Avatar asked Oct 24 '14 22:10

Tyler


1 Answers

If you are not handling the http request you won't have access to the request or the response, unless the code that it's making the request exposes that information somehow, which is not the case. So, I'm sorry but the answer is no.

However, if I may: what is exactly what you need from the response header? Because there could be other ways to obtain the information of the headers (i.e. cookies)

like image 98
Josep Avatar answered Sep 29 '22 10:09

Josep