Rafi Henig
Rafi Henig

Reputation: 6424

How can I determine if a previous route is external

I'm using Angular location.goBack navigation. I would like to disable a back navigation button if the next goBack execution will navigate outside of the app.

Is there a best practice way to achieve this?

Upvotes: 1

Views: 447

Answers (1)

Kasabucki Alexandr
Kasabucki Alexandr

Reputation: 630

This thing is really tricky. Browser history didn't provide a way to handle URLs. You can just do back. So, you detect navigation outside your app you have to implement your own history log.

But better avoid copping in app default browser functionality, because you will catch a lot of tricky bugs.

Upvotes: 2

Related Questions