My guess is that Angular first looks at the page and sees: <span ng-repeat='comp in components'>
Then it takes all the content in that span and puts it somewhere. Then the validation tie-in begins, and it doesn't see the different elements, therefore creating a singular scope for $error. Then the ng-repeat executes, filling in the fields. I would try putting the components into partials which may allow Angular to pick up on the Validation ahead of time? On Thursday, June 12, 2014 11:45:59 AM UTC-4, Sachin Singh Senger wrote: > > I am creating component builder like tool. So I need to get all the > components separately from JSON array and for that I did some work around. > > I have created a basic example for demonstrating my problem. > Jsfiddle: http://jsfiddle.net/sachin076/U3pVM/5991/ > > Here, I have used ng-repeat and because of my complex requirement, I have > written all the component's html like this. > > ISSUE: I have applied the validation on two separate text fields but on > changing the value of first text field the validation changes for second > field also. > > I don't have any clue that how below two expressions are changing when I > change the value in first text field only. > > {{myForm.Component1.$error.required}} > > {{myForm.Component2.$error.required}} > > Can anyone help me out? > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
