Widget name/id inside ng:repeat (v0.10.5)

293 views
Skip to first unread message

Stephane Bisson

unread,
Mar 15, 2012, 4:31:37 AM3/15/12
to AngularJS
Hi,

I am migrating a huge app from 9.19 to 10.5, with the firm intention
of migrating it to 1.0 in the near future. For some reason, for the
time being, I have to keep the ng:validate/$hover behaviour, i.e. the
callout that pops when you hover over an invalid widget.

I have a service strangely similar to the $hover service (R.I.P.) . It
is application wide and give details about the invalid widgets when
you hover over them. This service is trying to get to the widget
instance and its $error object based on the dom element it's hovering
over.

I have a form containing text input inside ng:repeat. I use
name="prefix_{{$index}}" on my inputs so that they have unique names.
I was hoping that they would be registered within the form using that
name but further analysis seems to indicate that the name attribute is
not yet resolved when the widgets gets created. Therefore, the widgets
are simply not accessible from the form object.

Here's the fiddle: http://jsfiddle.net/stephanebisson/U5TZx/

if I set name="hardcoded" on my inputs the first one will behave as
expected but the subsequent ones will not be added to the form since a
widget with the same name already exist.

ok, but what's your question?

Is there an easier way to accomplish what I am trying to do?

Am I going in the wrong direction considering I also want to migrate
to 1.0?

Any other comments/advice?

thanks,
stephane

Misko Hevery

unread,
Mar 15, 2012, 1:20:48 PM3/15/12
to ang...@googlegroups.com
I think you should upgrade to 1.0 and here is why. In 1.0:


--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.


Reply all
Reply to author
Forward
0 new messages