Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

220
Views
angularjs : validate dynamically created inputs from a component

I already read through a lot of questions in stackoverflow, but nothing works for me, i'm trying to validate an input that is created dynamically with ng-repeat and it's inside a component. This is my code, the input is invalid when i surpass the max-length but the error msg doesnt show.

<md-card ng-repeat="formfield in aaaaCtrl.formData.dynamicFields">
        <md-card-title flex>
            <md-card-content layout="column" layout-gt-sm="row" flex>
                <md-card-title-text flex="none" flex-gt-sm="30">
                    <md-input-container class="md-block">
                        <label for=titre{{$index}}>Titre</label>
                        <input ng-model="formfield.titre" name="titre{{$index}}" type="text" md-maxlength="50"
                            ng-disabled="formfield.titreParDefaut.titreBloque===true" style="font-weight:bold;" required>
                        <div ng-messages="aaaaForm['titre' + $index].$error">
                            <div ng-messages-include=app/aaa/messages/messages.html></div>
                        </div>
                    </md-input-container>
                </md-card-title-text>
            </md-card-content>
        </md-card-title>
    </md-card>

The messages are centralised on the file messages.html and it already works on the normal inputs, the aaaaForm is the name of the form.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!