code: function(key, value, writeAttr, attrName) {
          var booleanKey = getBooleanAttrName(this.$$element[0], key),
              $$observers = this.$$observers;
  
          if (booleanKey) {
            this.$$element.prop(key, value);
            attrName = booleanKey;
          }
  
          this[key] = value;
  
          // translate normalized key to actual key
          if (attrName) {
            this.$attr[key] = attrName;
          } else {
            attrName = this.$attr[key];
            if (!attrName) {
              this.$attr[key] = attrName = snake_case(key, '-');
            }
          }
  
          if (writeAttr !== false) {
            if (value === null || value === undefined) {
              this.$$element.removeAttr(attrName);
            } else {
              this.$$element.attr(attrName, value);
            }
          }
  
          // fire observers
          $$observers && forEach($$observers[key], function(fn) {
            try {
              fn(value);
            } catch (e) {
              $exceptionHandler(e);
            }
          });
        }
docs: Set a normalized attribute on the element in a way such that all directives
  can share the attribute. This function properly handles boolean attributes.
  @param {string} key Normalized key. (ie ngAttribute)
  @param {string|boolean} value The value to set. If `null` attribute will be deleted.
  @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.
  Defaults to true.
  @param {string=} attrName Optional none normalized name. Defaults to key.