src/core/services/layout/layout.js
function validateAttributeValue(className, value, updateFn) {
    var origValue;

    if (!needsInterpolation(value)) {
      switch (className.replace(SUFFIXES,"")) {
        case 'layout'        :
          if (!findIn(value, LAYOUT_OPTIONS)) {
            value = LAYOUT_OPTIONS[0];    // 'row';
          }
          break;

        case 'flex'          :
          if (!findIn(value, FLEX_OPTIONS)) {
            if (isNaN(value)) {
              value = '';
            }
          }
          break;

        case 'flex-offset' :
        case 'flex-order'    :
          if (!value || isNaN(+value)) {
            value = '0';
          }
          break;

        case 'layout-align'  :
          var axis = extractAlignAxis(value);
          value = $mdUtil.supplant("{main}-{cross}",axis);
          break;

        case 'layout-padding' :
        case 'layout-margin'  :
        case 'layout-fill'    :
        case 'layout-wrap'    :
        case 'layout-nowrap' :
          value = '';
          break;
      }

      if (value != origValue) {
        (updateFn || angular.noop)(value);
      }
    }

    return value ? value.trim() : "";
  }
function validateAttributeValue(className, value, updateFn) {
    var origValue;

    if (!needsInterpolation(value)) {
      switch (className.replace(SUFFIXES,"")) {
        case 'layout'        :
          if (!findIn(value, LAYOUT_OPTIONS)) {
            value = LAYOUT_OPTIONS[0];    // 'row';
          }
          break;

        case 'flex'          :
          if (!findIn(value, FLEX_OPTIONS)) {
            if (isNaN(value)) {
              value = '';
            }
          }
          break;

        case 'flex-offset' :
        case 'flex-order'    :
          if (!value || isNaN(+value)) {
            value = '0';
          }
          break;

        case 'layout-align'  :
          var axis = extractAlignAxis(value);
          value = $mdUtil.supplant("{main}-{cross}",axis);
          break;

        case 'layout-padding' :
        case 'layout-margin'  :
        case 'layout-fill'    :
        case 'layout-wrap'    :
        case 'layout-nowrap' :
          value = '';
          break;
      }

      if (value != origValue) {
        (updateFn || angular.noop)(value);
      }
    }

    return value ? value.trim() : "";
  }
function validateAttributeValue ( className , value , updateFn ) { var origValue ; if ( ! needsInterpolation ( value ) ) { switch ( className . replace ( SUFFIXES , "" ) ) { case 'layout' : if ( ! findIn ( value , LAYOUT_OPTIONS ) ) { value = LAYOUT_OPTIONS [ 0 ] ; // 'row'; } break ; case 'flex' : if ( ! findIn ( value , FLEX_OPTIONS ) ) { if ( isNaN ( value ) ) { value = '' ; } } break ; case 'flex-offset' : case 'flex-order' : if ( ! value || isNaN ( + value ) ) { value = '0' ; } break ; case 'layout-align' : var axis = extractAlignAxis ( value ) ; value = $mdUtil . supplant ( "{main}-{cross}" , axis ) ; break ; case 'layout-padding' : case 'layout-margin' : case 'layout-fill' : case 'layout-wrap' : case 'layout-nowrap' : value = '' ; break ; } if ( value != origValue ) { ( updateFn || angular . noop ) ( value ) ; } } return value ? value . trim ( ) : "" ; }
For the Layout attribute value, validate or replace with default
fallback value
For the Layout attribute value validate or replace with default fallback value