Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 1
    Not working when I test it. document.referer returns nothing in all the cases. Maybe it doesnt behave the this way when in angular2 ? Commented Feb 8, 2016 at 21:15
  • Im using angular2 router.navigate to navigate to the new state! Commented Feb 8, 2016 at 21:17
  • Aha, so you are not coming from another url? The url isn't changing? Commented Feb 8, 2016 at 21:19
  • I am coming from another URL. I am in localhost/myapp/signup and I navigate to /myapp/login USING angular Router.navigate method. For some reason document referer is always empty regardless of where I am coming from to /myapp/login. I m thinking angular should has this functionality to know which url I am coming from. Commented Feb 8, 2016 at 21:22