I am unable to find a solution in the existing answers, hence i am posting this.
I have a form which has many input fields, many of them are required.
There
You could set a flag so that you can show some kind of a required message or set some css class when the form is invalid.
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.name=undefined;
$scope.showMsgs = false;
$scope.preview = function(form){
if ($scope[form].$valid) {
alert("Previewed");
} else {
$scope.showMsgs = true;
}
};
$scope.update = function(form){
if ($scope[form].$valid) {
alert("Updated");
} else {
$scope.showMsgs = true;
}
};
});
.error {
border-color: red;
}