var dirty = false; >angular.forEach(scope.theForm, function (value, key) { > if (key[0] != '$') { > if (value.$dirty) { > dirty = true; > } > } >}); >if (!dirty) { >scope.theForm.$setPristine(); >}This will reset the form if all inputs are pristine.....
require: ['^form'],and use scope.form syntax where you used scope.theForm