Get error object from From Controller. It could be useful for login for errors. eg, sending errors to mixpanel on submit form.
Install bower package
bower install nebo-form-errors --save
Add to application module.
angular.module('app', [
...,
'formErrors'
]);
angular.module('app').controller('AppController', function ($scope, $errors) {
$scope.submit = function (form) {
if (form.$invalid) {
var formErrors = $errors.fromForm(form);
console.log('form errors', formErrors);
return;
}
};
});