code: function(element) {
        var parent = $mdUtil.getClosest(element, 'form');
        var form = parent ? angular.element(parent).controller('form') : null;
  
        return form ? form.$submitted : false;
      }
docs: Returns true if the parent form of the element has been submitted.
  
  @param element An AngularJS or HTML5 element.
  
  @returns {boolean}