Dynamic form name attribute <input type=“text” name=“{{ variable-name }}” /> in Angularjs

后端 未结 4 1452
忘掉有多难
忘掉有多难 2020-11-29 08:07

How would someone use formName.inputName.$valid when the \"inputName\" was dynamically created?

  
4条回答
  •  余生分开走
    2020-11-29 08:46

    I could not find the answer that satisfied some or all of these needs. This is what I came up with.

    There may be a better way, so please share your thoughts.
    I am using Angularjs 1.3.0-beta.8

    I have a form with multi-nested directives that all contain input(s), select(s), etc... These elements are all enclosed in ng-repeats, and dynamic string values.

    This is how to use the directive:

    
      
        ex: 
        ex: 
                            
        
    提交评论

提交回复
热议问题