Home  >  Article  >  Web Front-end  >  Examples of usage of angularjs-select2

Examples of usage of angularjs-select2

PHP中文网
PHP中文网Original
2017-06-21 10:02:203183browse

1.Introduction file

 '/select2.css', '/select2-bootstrap.css', '/select2.min.js',
‘/angular-select2.min.js’

2.Page

3.html

<select2 class="form-control" ng-model="modelName" s2-options="item.value as item.name for item in dataList" multiple="multiple" placeholder="-请选择-"></select2> //dataList是从接口请求来的数据 , modelName是多选的变量值

4.js

 $scope.getSelectDataList = url = (res.code===
$scope.dataList=['11111','101920'];//赋值

The above is the detailed content of Examples of usage of angularjs-select2. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:code war daily exercisesNext article:code war daily exercises