I want to create a DropDownList using @Html.DropDownList
and connect it with AngularJS.
Below is the code snippet:
@Html.DropDownList("LessonID", (SelectList)ViewBag.LessonList, "choose one", new { ng_model = "LessonID" })
Here's an example of how the data should look like: [LessonID:1, LessonName:English][LessonID:2, LessonName:Sport]......
Then the corresponding html code would be:
<select id="LessonID" class="ng-pristine ng-valid" ng-model="LessonID" name="LessonID">
<option value="? object:null ?"></option>
<option value="">choose one</option>
<option value="1">English</option>
<option value="2">Sport</option>
How can we make sure that the first option is not shown?
Is it possible to remove it?