我正在尝试填写选择选项(selectpicker),但没有成功。我的权限数组已正确填写,但在我的 HTML 中从未出现过选项。
有人可以帮我选择选择器吗?
JS
(() => {
angular
.module('talent')
.controller('FunctionalityCreateCtrl', Create);
function Create($timeout, GatewayService) {
const vm = this;
vm.form = {};
vm.competencesArray = [];
getCompetences();
function getCompetences() {
GatewayService.get('/competences')
.then((data) => {
vm.competencesArray = data._embedded;
})
.catch(() => {
console.log('nope');
});
}
}
})();
HTML
<select
class="selectpicker"
data-style="select-with-transition"
title="Select a value"
data-size="7"
ng-model="functionality.form.comp"
ng-options="s.name for s in functionality.competencesArray">
<option value=""> Select</option>
<select>