This answer is a little late, but I stumbled upon a solution that makes everything a LOT easier.
You can actually assign the form name directly to your controller if you're using the controllerAs syntax and then reference it from your "this" variable. Here's how I did it in my code:
I configured the controller via ui-router (but you can do it however you want, even in the HTML directly with something like <div ng-controller="someController as myCtrl">
) This is what it might look like in a ui-router configuration:
views: {
"": {
templateUrl: "someTemplate.html",
controller: "someController",
controllerAs: "myCtrl"
}
}
and then in the HTML, you just set the form name as the "controllerAs"."name" like so:
<ng-form name="myCtrl.someForm">
<!-- example form code here -->
<input name="firstName" ng-model="myCtrl.user.firstName" required>
</ng-form>
now inside your controller you can very simply do this:
angular
.module("something")
.controller("someController",
[
"$scope",
function ($scope) {
var vm = this;
if(vm.someForm.$valid){
// do something
}
}]);