gpt4 book ai didi

html - 无法在 Drop Down Angular Js 上显示特定数据

转载 作者:行者123 更新时间:2023-11-28 02:29:20 26 4
gpt4 key购买 nike

我有一个问题,似乎是我的下拉列表在我选择适当的选项时不显示数据。选项上有两种选择。

CSHTML

<ui-select ng-model="ctrl.requestType" theme="selectize" title="Choose type of requisition" style="min-width: 140px;">

<ui-select-match placeholder="Select type of requisition">
<span ng-bind="$select.selected.name"></span>
</ui-select-match>

<ui-select-choices repeat="existingRequestType.name as existingRequestType in ctrl.existingRequestTypes | filter: $select.search">

<span ng-bind-html="existingRequestType.name| highlight: $select.search"> -
</span>
</ui-select-choices>
</ui-select>

Angular.JS 格式

app.controller('myCtrl', function($scope, $http, $timeout, $interval) {
vm.existingRequestTypes = [{
name: 'Purchase'
},
{
name: 'Lease'
}
];
}

感谢您的帮助!

最佳答案

我敢肯定你忘了定义vm:

app.controller('myCtrl', function($scope, $http, $timeout, $interval) {
var vm = this;

vm.existingRequestTypes = [{
name: 'Purchase'
},
{
name: 'Lease'
}
];
}

app.controller('myCtrl', function($scope, $http, $timeout, $interval) {
$scope.existingRequestTypes = [{
name: 'Purchase'
},
{
name: 'Lease'
}
];
}

关于html - 无法在 Drop Down Angular Js 上显示特定数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47786443/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com