Why I cant get previous url in controller? : I work on my single page application project I use angujarjs 1.5.

At some point in my controller I need to get previous url.

I tried to use this row to get previous url:

      var prevUrl = $document[0].referrer;

and this:

    var prevUrl2 = document.referrer;

But `prevUrl` and `prevUrl2` are always empty.

When I use this row to go back:

    $window.history.back();

It works fine.

Any idea why 'prevUrl' and 'prevUrl2' is empty? 

Please help me!

