'use strict'; /** * @ngdoc directive * @name ngAnimateChildren * @restrict AE * @element ANY * * @description * * ngAnimateChildren allows you to specify that children of this element should animate even if any * of the children's parents are currently animating. By default, when an element has an active `enter`, `leave`, or `move` * (structural) animation, child elements that also have an active structural animation are not animated. * * Note that even if `ngAnimateChildren` is set, no child animations will run when the parent element is removed from the DOM (`leave` animation). * * * @param {string} ngAnimateChildren If the value is empty, `true` or `on`, * then child animations are allowed. If the value is `false`, child animations are not allowed. * * @example *

List of items:
Item {{item}}
.container.ng-enter, .container.ng-leave { transition: all ease 1.5s; } .container.ng-enter, .container.ng-leave-active { opacity: 0; } .container.ng-leave, .container.ng-enter-active { opacity: 1; } .item { background: firebrick; color: #FFF; margin-bottom: 10px; } .item.ng-enter, .item.ng-leave { transition: transform 1.5s ease; } .item.ng-enter { transform: translateX(50px); } .item.ng-enter-active { transform: translateX(0); } angular.module('ngAnimateChildren', ['ngAnimate']) .controller('MainController', function MainController() { this.animateChildren = false; this.enterElement = false; });
*/ var $$AnimateChildrenDirective = ['$interpolate', function($interpolate) { return { link: function(scope, element, attrs) { var val = attrs.ngAnimateChildren; if (isString(val) && val.length === 0) { //empty attribute element.data(NG_ANIMATE_CHILDREN_DATA, true); } else { // Interpolate and set the value, so that it is available to // animations that run right after compilation setData($interpolate(val)(scope)); attrs.$observe('ngAnimateChildren', setData); } function setData(value) { value = value === 'on' || value === 'true'; element.data(NG_ANIMATE_CHILDREN_DATA, value); } } }; }];