Bind Dropdownlist using angularjs
public JsonResult GetAllLatereason()
{
using (Latereason_INGEntities Obj = new Latereason_INGEntities())
{
List<LateReason> Late = Obj.LateReasons.ToList();
return Json(Late, JsonRequestBehavior.AllowGet);
}
}
$scope.GetAllLatereason = function () {
$http({
method: "get",
url: "http://localhost:62537/Package/GetAllLatereason"})
.then(function (response) {
$scope.Late_INGEntities = response.data;
}, function () {
alert("Error Occur");
})
};
<div class="col-sm-4 p-0">
<select ng-model="Locations" ng-options="location.Code as location.LocationDescription for location in Location_INGEntities" ng-init="GetAllLocation()" class="w-100 form-control"></select>
</div>