You simply need to quote the string and access it using the array syntax:

ng-show="create_form['phones['+$index+'].number'].$dirty"

That being said, is there a reason why you have to name forms like that? 
Are you submitting these forms to the server through a standard form post 
and require this syntax? It’s probably better to avoid names like this and 
use friendlier names, then just submit the form data using JSON.

On Saturday, January 4, 2014 1:47:06 PM UTC-8, Mauro Sanna wrote:

I have an input field whose attribute name is: 
> name="phones[{{$index}}].number"
>
> I want use a ng-show like this:
>
> ng-show="create_form.phones[$index].number.$dirty"
>
> but it does not work perhaps because the complex name phone[$index].number.
>
> How can I solve?
>

-- 
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/groups/opt_out.

Reply via email to