function safeAddClass($element, className) {
      try {
        $element.addClass(className);
      } catch(e) {
        // ignore, since it means that we are trying to set class on
        // SVG element, where class name is read-only.
      }
    }
@ngdoc method
@name $compile.directive.Attributes#$observe
@function

@description
Observes an interpolated attribute.

The observer function will be invoked once during the next `$digest` following
compilation. The observer is then invoked whenever the interpolated value
changes.

@param {string} key Normalized key. (ie ngAttribute) .
@param {function(interpolatedValue)} fn Function that will be called whenever
                the interpolated value of the attribute changes.
       See the {@link guide/directive#Attributes Directives} guide for more info.
@returns {function()} the `fn` parameter.