ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Ionic 1.3 error related to Ionic View LifeCycle

Open jdnichollsc opened this issue 10 years ago • 13 comments

Short description of the problem:

beforeLeave, leave and afterLeave don't work with Ionic 1.3, using in this case abstact state and nested views

What behavior are you expecting?

Call these events in the respective order

Regards, Nicholls

jdnichollsc avatar Apr 27 '16 03:04 jdnichollsc

Hi @jdnichollsc,

Can you provide a code pen showing your issue?

Thanks, Dan

danbucholtz avatar Apr 27 '16 04:04 danbucholtz

Yes Sir @danbucholtz, see please: http://codepen.io/jdnichollsc/pen/VaGgVm?editors=1010

Thanks in advance, Nicholls

jdnichollsc avatar Apr 27 '16 05:04 jdnichollsc

Part of the problem is that you're using version 1.0.0 in the codepen http://code.ionicframework.com/1.0.0/. If I change it to 1.3.0, the events fire beforeEnter > enter > afterEnter. The leave events don't fire in the example.

dually8 avatar Apr 29 '16 15:04 dually8

@dually8, @jdnichollsc,

Yep. I noticed that as well. I am updating some code related to life cycle events as we speak. Next week we should hopefully have a fix out in 1.3.1.

danbucholtz avatar Apr 29 '16 16:04 danbucholtz

@dually8 if you change the navigation from Gallery to Home doesn't work... with 1.0.0 or 1.3.0

jdnichollsc avatar Apr 30 '16 06:04 jdnichollsc

This will be fixed in the nightly build tonight.

http://code.ionicframework.com/#nightly

Please test and let me know if this resolves your issue. We added a ton of automated testing and fixed a ton of issues around life cycle events in the past few days.

Thanks, Dan

danbucholtz avatar May 04 '16 21:05 danbucholtz

The events don't fire for me since 1.3.1 I had to revert back to 1.3.0 for it to work.

Anybody else experienced it ?

lucasbeef avatar May 17 '16 12:05 lucasbeef

Hi @lucasbeef,

Can you provide a codepen? Is there an exception in the console or anything. Please let me know. I wrote a lot of tests and updated logic for that in 1.3.1. Please let me know what you're seeing so we can get it resolved.

Thanks, Dan

danbucholtz avatar May 17 '16 15:05 danbucholtz

Now works for me, thanks Sir @danbucholtz! :dancers: Link updated: http://codepen.io/jdnichollsc/full/VaGgVm/

jdnichollsc avatar May 18 '16 00:05 jdnichollsc

@danbucholtz Well, it's a mystery for me, I have basically the same code as in the codepen jdnichollsc provided. It works on 1.3.0 but not on 1.3.1.

I have no exception, nothing in the console either. The events simply don't trigger. I'd like to give you more intel, but I don't know where to look

lucasbeef avatar May 18 '16 12:05 lucasbeef

What is your codepen link? To review your code :)

jdnichollsc avatar May 18 '16 15:05 jdnichollsc

Ok, I got it working ! I found out that the events wouldn't trigger because my template wasn't encapsulated in an ion-view. It used to work that way.

Sorry about that :confused: And thank you ! It's really cool that you keep on improving and supporting V1 !

lucasbeef avatar May 24 '16 10:05 lucasbeef

Yes, thanks Ionic team for support Ionic 1.x! :dancers:

jdnichollsc avatar May 24 '16 13:05 jdnichollsc