I am a newcomer to Angular.js and this forum, and I am keen on trying out some basic concepts. However, I hit a roadblock while working with select and options elements.
In my small app, I aim to incorporate a select box, but I keep seeing a blank option that I want to eliminate.
Despite scouring Stackoverflow and Google for solutions, none of the suggestions or hints seem to be effective in resolving my issue.
I am hopeful that someone here can provide me with assistance...
About the application: I have various items with attributes such as item.Name or item.Price, and I wish to save the selected tag value under item.Store.
This section represents the view:
<td>
<select ng-model="item.Store" ng-options="item.storeName for item in items.Stores">
</select></td>
And this is the content present in my controller:
$scope.items.Stores = [
{storeId : 1, storeName : 'Spar' },
{storeId : 2, storeName : 'Billa' },
{storeId : 3, storeName : 'Merkur' },
];
One of the attempts I made was:
$scope.item.Store = $scope.items.Stores[1];
However, it consistently results in the error message: "$scope.item is undefined....", even though my ng-model is named item.Store as well. Hence, I suspect there might be an issue with the dot or something similar...
Thank you for your guidance, and if any crucial details are missing from the code, please inform me :-)