src/core/services/aria/aria.js
function expect(element, attrName, defaultValue) {

    var node = angular.element(element)[0] || element;

    // if node exists and neither it nor its children have the attribute
    if (node &&
       ((!node.hasAttribute(attrName) ||
        node.getAttribute(attrName).length === 0) &&
        !childHasAttribute(node, attrName))) {

      defaultValue = angular.isString(defaultValue) ? defaultValue.trim() : '';
      if (defaultValue.length) {
        element.attr(attrName, defaultValue);
      } else if (showWarnings) {
        $log.warn('ARIA: Attribute "', attrName, '", required for accessibility, is missing on node:', node);
      }

    }
  }
function expect(element, attrName, defaultValue) {

    var node = angular.element(element)[0] || element;

    // if node exists and neither it nor its children have the attribute
    if (node &&
       ((!node.hasAttribute(attrName) ||
        node.getAttribute(attrName).length === 0) &&
        !childHasAttribute(node, attrName))) {

      defaultValue = angular.isString(defaultValue) ? defaultValue.trim() : '';
      if (defaultValue.length) {
        element.attr(attrName, defaultValue);
      } else if (showWarnings) {
        $log.warn('ARIA: Attribute "', attrName, '", required for accessibility, is missing on node:', node);
      }

    }
  }
function expect ( element , attrName , defaultValue ) { var node = angular . element ( element ) [ 0 ] || element ; // if node exists and neither it nor its children have the attribute if ( node && ( ( ! node . hasAttribute ( attrName ) || node . getAttribute ( attrName ) . length === 0 ) && ! childHasAttribute ( node , attrName ) ) ) { defaultValue = angular . isString ( defaultValue ) ? defaultValue . trim ( ) : '' ; if ( defaultValue . length ) { element . attr ( attrName , defaultValue ) ; } else if ( showWarnings ) { $log . warn ( 'ARIA: Attribute "' , attrName , '", required for accessibility, is missing on node:' , node ) ; } } }
Check if expected attribute has been specified on the target element or child
@param element
@param attrName
@param {optional} defaultValue What to set the attr to if no value is found
Check if expected attribute has been specified on the target element or child