Posted almost 5 years ago. Visible to the public.

Partially disable animations for Angular 1.4+

If you use Angular 1.4+ together with Angular Animate, all ng-show, ng-hide, ng-class etc. are animated on default.

If you want only some elements to be animated there are 2 possibilities: Either disable animations globally and only run animations if the element has a certain class or enable animations globally and add a certain class if no animation is wanted.

Option 1: Enable animations only for html elements with class 'animate'

Copy
@app.config ['$animateProvider', ($animateProvider) -> $animateProvider.classNameFilter(/\banimate\b/) ]

Option 2: Disable animations only for elements with class 'no-animate'

Copy
@app.config ['$animateProvider', ($animateProvider) -> $animateProvider.classNameFilter(/^(?:(?!no-animate).)*$/) ]

makandra has been working exclusively with Ruby on Rails since 2007. Our laser focus on a single technology has made us a leader in this space.

Owner of this card:

Avatar
Judith Roth
Last edit:
almost 5 years ago
by Judith Roth
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Judith Roth to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more