'use strict';

/*
 * Binds the attributes to the expression once at startup,
 * Usage: <span fast-bind-attr-once="{attr1: myExpression, attr2: myOtherExpression}"></span>
 */


angular.module('fastBind.bindAttrOnce', []).
  directive('fastBindAttrOnce', ['$parse', function($parse) {
    return {
      compile: function compile(element, attributes) {
        var expr = $parse(attributes.fastBindOnce);

        return function link(scope, element) {
          var values = expr(scope);

          angular.forEach(values, function(value, key) {
            attrs.$set(key, value);
          });
        };
      }
    };
  }]);

'use strict';

/*
 * Binds the attributes to the expression once at startup,
 * Usage: <span fast-bind-attr-once="{attr1: myExpression, attr2: myOtherExpression}"></span>
 */


angular.module('fastBind.bindAttrOnce', []).
  directive('fastBindAttrOnce', ['$parse', function($parse) {
    return {
      compile: function compile(element, attributes) {
        var expr = $parse(attributes.fastBindOnce);

        return function link(scope, element) {
          var values = expr(scope);

          angular.forEach(values, function(value, key) {
            attributes.$set(key, value);
          });
        };
      }
    };
  }]);

Fix use of attrs => attributes
Fix use of attrs => attributes

I believe this was a copy and paste error, but the undefined attrs was used when it seems like it should be attributes.