Angular get index of selected item (from ng-options)
I am trying to get the index of a selected item from a ng-options list. I have this in my model but it doesn't work, I'm not sure what I am doing wrong here.
So, I have ng-options -
<select class="select" ng-model="level.Selection" ng-options="data for data in dataHere track by data.id"></select>
which is attached to the model, so right below it, I just try to spit out its selected item index like so:
Can't seem to see what I am doing wrong here. Thank!!
source to share