My code is designed to generate dynamic forms with unique names like the following:
<div ng-click="wos.wordWordFormRowClicked(wf, $index)"
ng-form="wos.wordFormNgForm_{{$index}}"
ng-repeat="wf in wos.word.wordForms">
The service responsible for this functionality is named "wos".
Currently, I am looking for a way to iterate over these dynamically created forms and check their $pristine status. One approach I'm considering involves using angular.forEach as shown below:
angular.forEach(self.word.wordForms, function (wf, key) {
// ?
});
A specific issue I'm facing is how I can access the corresponding wos service parameter within the forEach loop. These parameters would have names similar to:
wos.wordFormNgForm_1.$pristine
wos.wordFormNgForm_2.$pristine
wos.wordFormNgForm_3.$pristine