我想要 {{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>
最佳答案
<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
关于html - 为另一个选择选项传递参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36149891/