asp.net - Angularjs inlcudes an empty option in select -
i have dropdownlist data being bound dynamically way @ page_load:
<asp:dropdownlist id="ddlset" datatextfield="title" datavaluefield="pksetid" runat="server" appenddatabounditems="true" ng-model="setid"></asp:dropdownlist>
the rendered html :
<select id="cpcontent_ddlset" ng-model="setid"> <option value="? undefined:undefined ?"></option> <option value="3">test3</option> </select>
the option test3 should selected default when page loads, isn't happening. have set $scope.setid=3
, don't know value before hand.
i see similar questions here dropdownlists data bound angular way, can set selected item $scope.
how tackle this.
either build server side asp application or build client side angular application, don't mix 2 technologies.
let angular whole frontend logic , rendering , asp provide rest services.
see angulars select example how preselect dropdown value.
Comments
Post a Comment