如何使用angularjs显示基于选择框的选项卡
以下是我的代码,用于根据ng选项选择国家/地区,并根据ng重复获取选项卡:如何使用angularjs显示基于选择框的选项卡,angularjs,Angularjs,以下是我的代码,用于根据ng选项选择国家/地区,并根据ng重复获取选项卡: <select ng-model="country" ng-options= "countryName.country for countryName in countryNames" ng-change="getCountry()"> </select> <ul id="configPhoneTab" class="nav nav-tabs equipmentTab agenttabs"
<select ng-model="country" ng-options= "countryName.country for countryName in countryNames" ng-change="getCountry()">
</select>
<ul id="configPhoneTab" class="nav nav-tabs equipmentTab agenttabs">
<li class="active" ng-repeat= "configTab in config" val="configTab[0]">
<a href="#" data-toggle="tab">{{configTab.tabs}}</a>
</li>
</ul>
如何根据国家/地区选择从json中检索标签标题?您可以使用第三方库,如[UndermarkeJS],并使用它的一些函数检索所需的数据,例如33;。。。如果“罚款……”
您的搜索将基于$scope.country,它绑定到您的标记中。您的选项卡与国家有何关联?我只想根据我的选择框选项显示json数组中的数据。例如,如果我的选择框选项是India。我想用语音、传真等获取印度号码和免收费标签。
[
{
"country": "India",
"tabs": [
{
"title": "India Number",
"type": [
"VOICE",
"FAX",
"VN"
],
"carrier": "L3",
},
{
"title": "Toll Free",
"type": [
"TF"
],
"carrier": "L3",
}
]
},
{
"country": "Aus",
"tabs": [
{
"title": "Aus Number",
"type": [
"VOICE",
"FAX",
"VN"
],
"carrier": "L3",
},
{
"title": "Toll Free",
"type": [
"TF"
],
"carrier": "L3",
}
]
}