AngularJS Formly - Setting ID/Name of fields

I originally asked this question as a comment in another formly releated question here on SO. I figured that this really should be its own question...

I have a repeating section of fields very similar to the following example: http://angular-formly.com/#/example/advanced/repeating-section

Looking at the repeater example, all of the fields have the same model name/id just in a different element of the investments array. Is it possible to give these fields a unique name/id? (investmentName_1, investimentName_2, etc) My validation is flagging the same field among all of the repeated sections whenever one of them fails validation. I have a feeling it is because they all have the same model name/id and thus my validation code is flagging all of them.

Answers


You can specify an id property on your field configuration. I updated the example to add a random ID property to the fields. Hopefully this fixes your issue.


Need Your Help

Android: default music player widget on lockscreen

android widget player lockscreen

I have my own music player and I want to interact with the DEFAULT player widget on the lock screen. So my question is how can I make this widget display on lock screen like what google player is d...

Use didSelectRowAtIndexPath or prepareForSegue method for UITableView?

iphone objective-c uitableview storyboard

I'm using storyboards and I have a UITableView. I have a segue setup that pushes from my table to the detail VC. But which method should I use to handle this? I'll have to pass a couple objects ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.