Home >Web Front-end >JS Tutorial >Examples of usage of angularjs-select2
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!