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

controller tries to revalidate a form after exiting state #2575

Closed
royair opened this issue Feb 22, 2016 · 5 comments
Closed

controller tries to revalidate a form after exiting state #2575

royair opened this issue Feb 22, 2016 · 5 comments

Comments

@royair
Copy link

royair commented Feb 22, 2016

hi, i have a dummy angular's blog project:
the state hierarchy goes like this:

  • admin (abstract)
  • |-admin.list (a list of all posts to admin)
  • |-admin.edit (a single post edit)
  • |-admin.add (for adding a new post)

under edit.html (state: admin.edit) i have a form named 'postForm' with some validation on it.
for some reason, when exiting the state using ui-sref="admin.list" - angular tries to digest the old state, with no success of course, since 'postForm' does no longer exists thus no validation can be performed.

have any idea why ui-router tries to digest old state when exiting?
screenshot001

p.s.
validation works fine.

the project can be found here:
https://github.com/royair/blog/
to install:

  1. clone project
  2. npm i
  3. npm start

thanks in advance!

@royair royair changed the title controller tries to tries to revalidate a form after exiting state controller tries to revalidate a form after exiting state Feb 22, 2016
@eddiemonge
Copy link
Contributor

Any chance you could boil it down to a smaller example as there is a lot of code to go through

@christopherthielen
Copy link
Contributor

I went through the trouble of spinning up a vm and cloning this repo

@royair do I need credentials to login or something to even reproduce this?

@royair
Copy link
Author

royair commented Feb 24, 2016

Hi @christopherthielen
thanks for helping!

i have created a new branch to reflect the issue
please use: 'ui-router-bug'

regarding creds, you can use:
email: test@test.com
pwd: 123456

once installed (1. clone project 2. npm i 3. npm start)
go to http://localhost:8081/#/admin/add
and click the admin link at the top.
you should be able to see some errors at the console.

@christopherthielen
Copy link
Contributor

This is related to the code we added for #1643

I think we will be reverting that code in 0.2.19 in favor of exposing the animation promise: #2562

See also #2485

In the meantime, update to ui-router 0.2.18 and add noanimation to your ui-view tag
<div ui-view noanimation></div>

@christopherthielen
Copy link
Contributor

dupe #2579

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

No branches or pull requests

3 participants