Skip to content

Commit

Permalink
Fixed error when no form
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-thoni committed Jun 22, 2017
1 parent 7417a93 commit cf2b00f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/mdpDatePicker/mdpDatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ module.directive("mdpDatePicker", ["$mdpDatePicker", "$timeout", function($mdpDa
scope.model = ngModel;

scope.isError = function() {
return !!ngModel.$invalid && (!ngModel.$pristine || form.$submitted);
return !!ngModel.$invalid && (!ngModel.$pristine || (form != null && form.$submitted));
};

scope.required = function() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/mdpTimePicker/mdpTimePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ module.directive("mdpTimePicker", ["$mdpTimePicker", "$timeout", function($mdpTi
scope.model = ngModel;

scope.isError = function() {
return !!ngModel.$invalid && (!ngModel.$pristine || form.$submitted);
return !!ngModel.$invalid && (!ngModel.$pristine || (form != null && form.$submitted));
};

scope.required = function() {
Expand Down

0 comments on commit cf2b00f

Please sign in to comment.