AngularJs dynamic name for a form inside ng-repeat

前端 未结 2 826
野的像风
野的像风 2020-12-06 09:46

How do I name a form inside ng-repeat with a dynamic name?

2条回答
  •  無奈伤痛
    2020-12-06 10:02

    You can just do:

    
    

    EDIT:

    You can use ng-init as well, like so:

    //few form elements

    If it's just to apply a class based on validity of the form, then you could apply styling to automatically added classes, such as: ng-valid:

    .ng-valid {
       background-color: green;
    }
    

提交回复
热议问题