G
G
Greg Popov2015-09-09 13:16:53
Angular
Greg Popov, 2015-09-09 13:16:53

Non-lag animated page transition in Angular?

I found one correct solution with the help of ngAnimate, but:
1. I'm not satisfied with the fact that the animation is not clear how (if at all possible) to track. More specifically: if I go to another page, then on a slow Internet, it would not be bad to display the preloader in between these actions.
2. With an animated approach to changing pages, you need to twist them to the beginning. How to implement it CORRECTLY.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2015-09-09
@healqq

The preloader can be shown through a combination of onRouteChangeStart and the resolve parameter in the route.
That is, in resolve we return a Promise that loads the content, and RouteChangeSuccess will not happen until the Promise resolves. Here is a good article about resolve: ode2code
Scrolling can be added to the onRouteChangeSuccess event for example. It's not very clear what exactly you mean by scrolling, an example would be very helpful.
Regarding the slow Internet: it makes sense to pack all the templates into a .js file. For grunt there is this thing: github. It collects the templates in a js file and puts them in the templateCache of the angular. There will be a small overhead at startup, but there will be no additional loading at the first use of the template.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question