[SOLVED] Mechanism to detect the end of a transition


#1

Hi,

I would like to execute some code once a particular view has finished transitioning into place, for example focus on an input field, thus revealing the keyboard. I know that the angularJS $animate service enables you to define a callback to be executed on transition end, however I can’t see how to configure ionic to pass a callback through to angular.

Is there an event that I can tie a handler to, or some way to pass a callback through?

I have looked into the following approaches, but have found them lacking:

  • execute code when ngView’s $viewContentLoaded event fires, this fires too early
  • apply an arbitrary $timeout, which is rather imprecise and device dependent

Thanks in advance


#2

Is there anyone get any ideas about this mechanism? I am still struggling finding solution but I haven’t got any luck yet


#3

For the benefit of those who might read this post, I thought I’d update this thread with the awesome solution the Ionic guys have provided:

View LifeCycle and Events
Its currently in the nightly distribution, but will probably be part of the upcoming beta14