我想在另一个选项中查询{{fetch.university_id}} !!这样我就可以从MySQL数据库获得大学入学名单。但我不能得到适当的方式我想fetch.university_id作为docol()方法的参数
<div class="input-label" ng-init="doUni()">
University
</div>
<select ng-model="fetchData.university" >
<option name="{{fetch.university_id}}" ng-repeat="fetch in list" >{{fetch.university_name}}</option>
</select>
<div class="input-label" ng-init="doCol()">
College
</div>
<select ng-model="fetchData.college" >
<option name="{{fetch.college_id}}" ng-repeat="fetch in collist" >{{fetch.college_name}}</option>
</select>
答案 0 :(得分:0)
<div class="input-label" ng-init="doUni()">
University
</div>
<select ng-model="fetchData.university" data-ng-change="controllerFunction (fetchData.university )">
<option name="{{fetch.university_id}}" ng-repeat="fetch in list" >{{fetch.university_name}}</option>
</select>
In your controller :
scope.controllerFunction = function (obj) {
Paas this to your server to fetch colleges --> obj.university_id
Initialise the response data to --> collist