我目前使用AngularJS和Bootstrap.
我想制作一个类型,当他被选中时(当我点击它时)显示所有选项,不仅当我在上面写了一些东西时.就像 this site上使用JQuery的例子(我不能使用JQuery).
我想制作一个类型,当他被选中时(当我点击它时)显示所有选项,不仅当我在上面写了一些东西时.就像 this site上使用JQuery的例子(我不能使用JQuery).
这是我的控制器
countrycatControllers.controller('CountryListCtrl',['$scope',function ($scope) { $scope.listCountry = [ {"name": "Switzerland"},{"name": "France"},{"name": "Spain"},{"name": "Brazil"},{"name": "Argentina"},{"name": "USA"},{"name": "Canada"},{"name": "China"},{"name": "Germany"},{"name": "Italy"} ]; } ])
这是我的HTML输入:
<pre>Model: {{country | json}}</pre> <input data-ng-model="country" typeahead="item.name for item in listCountry | filter:$viewValue"/>
Select2插件有一个100%的角度指令.