To get the value of select using ng-modle, or can not get the value of select

ng-bind scope from $ -> View of the way binding 
ng -modle is $ scope <-> view of the two-way binding
                    <form role="form" class="form-inline">
                    
<div class="form-group"> <label for="nj">年级:</label> <select name="nj" id="nj" class="form-control" ng-model="myNJ">> <option ng-repeat="op in njs " value="{{op.id}}">{{op.name}}</option> </select> </div>
<div class="form-group"> <label for="zy">年级:</label> <select name="zy" id="zy" class="form-control" ng-model="myZY"> <option ng-repeat="op in zys " value="{{op.id}}">{{op.name}}</option> </select> </div>
<button type="submit" class="btn btn-primary" id="chaxun" ng-click="fn1()" >查询</button> </form>

 

Guess you like

Origin www.cnblogs.com/qqhfeng/p/11407500.html