2016-03-22 17 views
0

別の選択肢のオプションで{{fetch.university_id}}を検索したい!!私は大学のデータベースをMySQLデータベースから取得しています。しかし、私は()メソッド別の選択肢のパラメータを渡す

<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

オプションを持っている必要があり、私はdocolのためのパラメータとしてfetch.university_idたい適切なwayIを得るカント値liの値属性ke 'value =" {{fetch.university_id}} "' –

答えて

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 
関連する問題