Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(input): check if parent form is undefined before checking if it's…
Browse files Browse the repository at this point in the history
… submitted

Fixes #6807. Closes #6809.
  • Loading branch information
epelc authored and ThomasBurleson committed Jan 22, 2016
1 parent f079d67 commit 34e0278
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/input/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,9 @@ function inputTextareaDirective($mdUtil, $window, $mdAria) {

var isParentFormSubmitted = function () {
var parent = $mdUtil.getClosest(element, 'form');
var form = parent ? angular.element(parent).controller('form') : null;

return parent ? angular.element(parent).controller('form').$submitted : false;
return form ? form.$submitted : false;
};

scope.$watch(isErrorGetter, containerCtrl.setInvalid);
Expand Down

0 comments on commit 34e0278

Please sign in to comment.