1

我對Angular JS UI Bootstrap擴展類型有問題。Angular JS UI Bootstrap Typeahead

我想創建預輸入的幫助下,產品搜索,但卻我與顯示結果列表中掙扎。

我能夠從控制器查詢我做回我的產品,我在輸入欄中輸入的值。

我感謝您的幫助!

HTML頁:

<pre>{{productsearchs | json}}</pre> 
<input type="text" class="form-control" placeholder="Which product?" ng-model="selectedProduct" typeahead="productsearch as productsearch.name for productsearch in searchProduct($viewValue)"> 

角控制器:

// ## Suchen von Produkten nach User Eingabe 
$scope.searchProduct = function (val) { 
    var productsearch = Product.query({name: val}, function() { 
     return $scope.productsearch = productsearch; 
    }); 
} 

我在前臺看到了什麼:

http://i.stack.imgur.com/14mhk.png

回答

相關問題