Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

225
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda