-
Notifications
You must be signed in to change notification settings - Fork 2k
fix clientside angular validation on article example, issue #238 #247
Conversation
Why could you not use |
"Submitted" was already the variable name used in: https://github.com/meanjs/mean/blob/master/public/modules/articles/views/edit-article.client.view.html I think the idea of using a scope variable instead of just articleForm.$invalid, is that we don't want to show an error until we have "tried" to submit the form. If we just use articleForm.$invalid, this will show as invalid right away before we do anything (when it's empty). That's just personal preference, again, that was the existing logic, I wasn't trying to change any behaviour here, I just want to fix the bug using the existing codebase, not introduce a new feature. |
Ah ok, maybe a wider spread issue then ;) |
details on breaking changes: https://github.com/angular-ui/bootstrap/blob/eec68d81f4f72363d37493c495b 892347bdb9e1b/CHANGELOG.md
article.$save(function(response) { | ||
$location.path('articles/' + response._id); | ||
$scope.create = function(isValid) { | ||
if (isValid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good idea to check, but it would probably make more sense to set the inputs as required and not have to do a check in JS if necessary. Thoughts?
@jeromegv let's keep dependency updates out of this PR because it is about something else. Otherwise I like validating it, but does doing form validation through HTML not work? |
@jeromegv if it's still relevant for 0.4.0 branch can you please submit a new PR? |
Thanks @codydaig so we can close this. |
No description provided.