New to AngularJS
and trying to extract an integer from select options. Here is the setup:
<select class="form-control" id="decimation" placeholder="1 or 8" ng-model="data.settings.decimation">
<option type="number" value="1" ng-click="deci_bool=0">1</option>
<option type="number" value="8" ng-click="deci_bool=1">8</option>
</select>
The goal is to link this input with the option values:
<input ng-if="!deci_bool" type="number" class="form-control" id="b_mesu" placeholder="Between 0 and {{data.settings.decimation + 96 }}" ng-model="data.settings.b_mesu" min="0" max="97" step="1" ng-click="b_mesu_ctrl" required>
However, it appears that data.settings.decimation + 96
is being treated as a string.
I attempted to solve this issue by following a post on SO
where I added the following line in the select
tag:
ng-options="values.indexOf(data.settings.decimation) for data.settings.decimation in values"
But this resulted in an error message:
Error: [ngOptions:iexp] Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_'
Can anyone provide assistance?