Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling both a default starting state and 404 errors. #3336

Closed
floatingpurr opened this issue Feb 14, 2017 · 2 comments
Closed

Handling both a default starting state and 404 errors. #3336

floatingpurr opened this issue Feb 14, 2017 · 2 comments
Milestone

Comments

@floatingpurr
Copy link

Hi there. I'd like to handle both a default state for the first page get and show a 404 error template if a url does not exist. I'm trying with

$urlRouterProvider.otherwise("/");

That solve my first problem but, of course, anytime an incorrect url is typed, ui-router load the starting state. Is there a way to handle those two cases separately?

@ghost
Copy link

ghost commented Feb 16, 2017

+1

@christopherthielen
Copy link
Contributor

We will add an API for this soon.

In the meantime you should be able to use a function for otherwise that picks the URL to redirect to. It can check the ui router globals transition history to see if it is before any transitions have started

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants