model view controller - in angularjs dropdown data comming from database but not showing in menu -
here im using mvc angularjs here im getting data database why dropdown not display vale values html coding
<div class="form-group"> <div class="row"> <div class="col-md-2 col-sm-2" style="margin-left:20px"> <b>country</b> </div> <div class="col-md-8 col-sm-8"> <select ng-model="countryid" ng-options="i.countryid i.countryname in countylist" ng-change="getstates()"> <option value="">country</option> </select> </div> </div> </div>
angular code
function getcountrys(){ var ddd = mysercive.bindcntrylist(); ddd.then(function (d) { $scope.countylist = d.data; }) }
where u calling getcountrys() function? try call when page load via
<div ng-init="getcountrys();">
at template, or other way. understand?
Comments
Post a Comment