diff options
| author | Matias Niemelä | 2013-12-16 15:45:57 -0500 | 
|---|---|---|
| committer | Matias Niemelä | 2013-12-19 16:37:29 -0500 | 
| commit | cef084ade9072090259d8c679751cac3ffeaed51 (patch) | |
| tree | fe42b514dbbbdd893122fa3f7c7d647afba676b7 /src/ng/animate.js | |
| parent | 937caab6475e53a7ea0206e992f8a52449232e78 (diff) | |
| download | angular.js-cef084ade9072090259d8c679751cac3ffeaed51.tar.bz2 | |
feat(ngAnimate): provide configuration support to match specific className values to trigger animations
Closes #5357
Closes #5283
Diffstat (limited to 'src/ng/animate.js')
| -rw-r--r-- | src/ng/animate.js | 22 | 
1 files changed, 22 insertions, 0 deletions
| diff --git a/src/ng/animate.js b/src/ng/animate.js index b662d9c1..fa5b936d 100644 --- a/src/ng/animate.js +++ b/src/ng/animate.js @@ -61,6 +61,28 @@ var $AnimateProvider = ['$provide', function($provide) {      $provide.factory(key, factory);    }; +  /** +   * @ngdoc function +   * @name ng.$animateProvider#classNameFilter +   * @methodOf ng.$animateProvider +   * +   * @description +   * Sets and/or returns the CSS class regular expression that is checked when performing +   * an animation. Upon bootstrap the classNameFilter value is not set at all and will +   * therefore enable $animate to attempt to perform an animation on any element. +   * When setting the classNameFilter value, animations will only be performed on elements +   * that successfully match the filter expression. This in turn can boost performance +   * for low-powered devices as well as applications containing a lot of structural operations. +   * @param {RegExp=} expression The className expression which will be checked against all animations +   * @return {RegExp} The current CSS className expression value. If null then there is no expression value +   */ +  this.classNameFilter = function(expression) { +    if(arguments.length === 1) { +      this.$$classNameFilter = (expression instanceof RegExp) ? expression : null; +    } +    return this.$$classNameFilter; +  }; +    this.$get = ['$timeout', function($timeout) {      /** | 
