After reviewing the following resources: Reset Form in AngularJS and Angular clear subform data and reset validation, I am attempting to develop a flexible form reset/clear function that would resemble the code snippet below:
$scope.clearSection = function(formName){
$scope.formName.$setPristine();
$scope.formName.$setUntouched();
};
Is it feasible to create such a dynamic clearing function in Angular where the form name can be dynamically provided as an argument?