Greetings to everyone.
I am looking for a way to display the data in my form, which currently returns an empty object when I try to log it using $scope.subMe
.
The form element looks like this:
<form name="myForm" ng-submit="subMe()">
<input type="text" name="name" value="" />
</form>
I have several input elements in the form and would like to know the best practice for checking the validity of the form on the backend. Is it recommended to use something like the following code snippet?
var _valid = $http.post();
if ( _valid) {
if ( createUserSuccess() ){
showSucceess();
} else {
showError();
}
} else {
showBadFilledFormElements();
}
Any advice or insights would be appreciated. Thank you!