function evalAttr(attr, locals) {
    if ($attrs[attr]) {
      $scope.$parent.$eval($attrs[attr], locals || {});
    }
  }
Evaluates an attribute expression against the parent scope.
@param {String} attr Name of the attribute to be evaluated.
@param {Object?} locals Properties to be injected into the evaluation context.