Very new to angular and currently stock in something
I have a dropdown that is set up like this
<div class="col-md-3" ng-repeat="item in templateCtrl.template.templateDetails">
<select class="form-control" ng-model="item.categoryID" ng-options="category.categoryName for category in templateCtrl.categories track by category.categoryID"></select>
</div>
It populates the dropdown but item.categoryID (all values are 1) is not selected. Help on this matter will be greatly appreciated
You need to fix a few things in your
<select>element: usecategory.id as category.namein your ng-options.If you want one of the options to be pre selected when loading the page or view you can do it with
ng-init. In there you can set the model of that select to the value that has to be selected.