Home > Web Front-end > JS Tutorial > Examples of usage of angularjs-select2

Examples of usage of angularjs-select2

PHP中文网
Release: 2017-06-21 10:02:20
Original
3354 people have browsed it

1.Introduction file

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

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是多选的变量值
Copy after login

4.js

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

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!

Related labels:
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template