This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Return a promise from $location.path (and search) to detect if the change was cancelled #7392
Open
Description
Currently if you do a $location.path("/blah") (with optional .search) you have no way of knowing if someone has cancelled your attempt at changing the path by using a listener on $locationChangeStart + event.preventDefault()
Currently there is no event for $locationChangeFailed so it's near impossible to know if you path change attempt was cancelled without some hackery or custom events that are emitted in the code that is calling event.preventDefault().