ng-select ngoptions, binding array index to ng-model

75 views
Skip to first unread message

skytracer

unread,
May 30, 2013, 3:16:57 AM5/30/13
to ang...@googlegroups.com
Hello

My goal was to bind the index of an array used for ng-select source to a ng-model.
I was under the impression that, when using a pure array {a,b,c] as source for ng-select, the bind to ng-model will be the index of array instead of the actual array value.
I see that the option value is the array index but the model reflects the array value instead of index.
I have managed to make it work as array.indexOf ..as.. but I am not sure whether this is the right way

Plunker here :
http://plnkr.co/edit/oz56XN?p=preview

Thanks

Reply all
Reply to author
Forward
0 new messages