我使用angularjs和bootstrap-ui來構建一些選項卡。AngularJS ng-repeat bootstrap-ui選項卡
我想兩個標籤:
成績和入學考試。我的JSON看起來像這樣(如果我需要,我可以改變這一點):
[
{
"name":"University of Aberdeen",
"sections": [
{
"title": "Grades",
"data" : [
{
"heading": "GCE - AS Levels",
"paragraph": "Do not currently form part of academic requirement. AS module resits are permitted providing the final three A levels are undertaken simultaneously over two years of study. GCSE English and Maths needed at grade C minimum."
},
{
"heading": "Re-application",
"paragraph": "Reapplication is accepted with no disadvantage to the applicant."
}
]
},
{
"title": "Entrance exam",
"data" : [
{
"heading": "GCE - AS Levels",
"paragraph": "Do not currently form part of academic requirement. AS module resits are permitted providing the final three A levels are undertaken simultaneously over two years of study. GCSE English and Maths needed at grade C minimum."
},
{
"heading": "Re-application",
"paragraph": "Reapplication is accepted with no disadvantage to the applicant."
}
]
}
]
}
]
我試圖做的是使用NG重複,並在等級標籤,你只能看到第一組數據和第二個選項卡只能看到第二個數據數組。
<tabset type="pills">
<tab ng-repeat="tab in tabs" heading="{{tab.title}}" select="getContent()" active="tab.active" disabled="tab.disabled">
<h1>{{tab.title}}</h1>
<div ng-repeat="item in tabs.content">
<div ng-repeat="item in item.sections">
<div ng-repeat="item in item.data">
<h3>{{item.heading}}</h3>
<p>{{item.paragraph}}</p>
</div>
</div>
</div>
</tab>
</tabset>
當前兩組數據都被拉入兩個選項卡。任何建議將被認真考慮。提前致謝。
謝謝帕特里克,但不幸的不是。我知道如果我設置一個小提琴會更容易確定,當我有機會時會嘗試這樣做。 – Pianoc
好吧我會盡量留意這個頁面,等待小提琴。 –
嗨帕特里克,這裏是一個Plunker來簡化這個:http://plnkr.co/edit/iIJVuIxspDRedN7ZXiTK?p=preview – Pianoc