Adding page transitions using ngAnimate

Right now, the pages change abruptly when swiped upon; we would ideally like pages to slide in, to give it a more pleasant feel.

We will make use of the ngAnimate module to achieve our page transitions; it has been completely rewritten for Angular 1.2.x branches. It provides CSS3 transition and keyframe animation support for various AngularJS directives and controls.

Currently, the following directives support animations for enter and exit events:

  • ngView
  • ngRepeat
  • ngInclude
  • ngIf
  • ngSwitch
  • ngClass
  • ngShow
  • ngHide

The way ngAnimate works is it simply adds ng-enter and ng-leave CSS classes to the directive.

We are then required to write our own CSS3 transition effects for these classes. Let's see how to go about doing this. ...

Get AngularJS Web Application Development Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.