Code coverage report for src/directive.js

Statements: 100% (7 / 7)      Branches: 100% (2 / 2)      Functions: 100% (4 / 4)      Lines: 100% (7 / 7)      Ignored: none     

All files » src/ » directive.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19    1 2     2 3 1   1             1  
'use strict';
 
module.exports = function ($animate) {
  return {
    restrict: 'EA',
    link: function (scope, element, attributes) {
      scope.$watch(attributes.animateChange, function (newVal, oldVal) {
        if (newVal !== oldVal) {
          $animate.addClass(element, attributes.changeClass)
            .then(function () {
              return $animate.removeClass(element, attributes.changeClass);
            });
        }
      });
    }
  };
};
module.exports.$inject = ['$animate'];