2013-12-10 74 views
0

我有自動完成AngularJS自動完成不工作在IE8

<div id="ng-app" ng-app ng-controller="AutoCtrls"> 
    <input list="names" ng-model="selected"> 
    <datalist id="names"> 
     <option value="{{name}}" ng-repeat="name in names"></option> 
    </datalist> 
    selected = {{selected}} 
</div> 

和app.js

function AutoCtrls($scope, Restangular) { 
    $scope.names = ["john", "bill", "charlie", "robert", "alban", "oscar", 
    "marie", "celine", "brad", "drew", "rebecca", "michel", "francis", "jean", 
    "paul", "pierre", "nicolas", "alfred", "gerard", "louis", "albert", 
    "edouard", "benoit", "guillaume", "nicolas", "joseph"]; 
    alert('ok 1'); 
} 

我現在面臨的問題是,這並不在IE8中工作,但是下面的代碼這可以在Chrome和Firefox中使用。

可能是什麼原因,我該如何解決這個問題?

回答

1

IE8和9不支持<datalist>http://caniuse.com/datalist

+0

傑夫什麼其他候補的''? – user75ponic

+1

有[Angular-UI的typeahead](http://angular-ui.github.io/bootstrap/#/typeahead),可能還有其他一些東西。 –

+0

謝謝傑夫指着'打字機'。 – user75ponic