I have several elements that get their data from a Json object and populate it with angular.
<select ng-model="MyCtrl.cargoList"> <option ng-repeat="cargo in MyCtrl.cargoList">{{ cargo.name }}</option> </select>
And whenever I load the form, I get something like this in my console:
<select ng-model="MyCtrl.cargoList"> <option value="? object:25 "?></option> <option value="">Gloves</option> <option value="">Jacket</option> <option value="">Shoes</option> </select>
I can get the values so that they look just fine, but I cannot get rid of the very first option. I do not mind the selection box showing the very first item in the list, but I do not want it to be an empty string. How can I get rid of it?
javascript arrays angularjs select
Miles peterson
source share