[Route("metadata")] public IHttpActionResult GetMetaData() { var itemTrees = _itemTreeAdapter.GetAll().Select(it=> new {id = it.NodeId, Descrip = it.Descrip}).OrderBy(it=>it.Descrip); return Ok(new {ItemTrees = itemTrees }); }So, I thought I'd try adding an extra option in the js code using the following code:
var defaultOption = [{ id: 0, descrip: 'Select Item Tree...' }]; $scope.metaData.itemTrees.splice(0, 0, defaultOption);I can see that the item is added fine, but for some weird reason this option is not shown up in the list of options!!!
<select class="form-control" ng-model="currentSalespoint.iTreeTop" ng-options="t.id as t.descrip for t in metaData.itemTrees"> <option value="">Select Item Tree...</option> </select>I try to use option value = "0". In this case that option is not shown in the list of options. Do you know why?