0
我使用angular-ui庫創建了一個typeahead。使用angular-ui的Typeahead
我現在的預輸入HTML是:
<input name="customers" id="customers" type="text" placeholder="enter a customer" ng-model="selectedCustomer" uib-typeahead="customer.firstName for customer in customers | filter: $viewValue | limitTo:8" class="form-control" typeahead-editable="false">
基本上預輸入搜索工作正常,但是當我選擇類型提前我想檢索其連接到客戶記錄,如姓氏的所有字段,地址等。typeahead被填充到我的控制器中名爲$ scope.customers的屬性中,通過ajax調用api來獲取所有客戶。
所以在選擇我怎麼能得到所有與選定的客戶相關的領域?
乾杯
你在問如何知道什麼時候觸發了typeahead或如何做ajax調用?我想我錯過了這個問題。 – Paarth
不,我想知道當我在前面選擇選項時,有一個客戶記錄已用於填充前面的字符,但我只顯示名字。基本上選擇,我想得到其他屬性,如姓等。希望有道理 – tjhack
「讓他們」在哪裏? – Paarth