我有銀行自帶的分期付款清單,我想重複銀行支持分期付款或不在付款頁面上的列表。列表必須是數到9,從2ng-if與ng-if表達式的多重ng-
開始,這是JSON(僅包括第一銀行)
[{
"Installments": [{
"InstallmentId": 9,
"InstCount": 2,
"InstRate": 0,
"BankId": 1,
"Info": false
}, {
"InstallmentId": 10,
"InstCount": 3,
"InstRate": 0,
"BankId": 1,
"Info": false
}, {
"InstallmentId": 11,
"InstCount": 4,
"InstRate": 7.30,
"BankId": 1,
"Info": false
}, {
"InstallmentId": 12,
"InstCount": 5,
"InstRate": 0,
"BankId": 1,
"Info": false
}, {
"InstallmentId": 13,
"InstCount": 7,
"InstRate": 4.50,
"BankId": 1,
"Info": false
}, {
"InstallmentId": 14,
"InstCount": 9,
"InstRate": 11.28,
"BankId": 1,
"Info": false
}],
"BankId": 1,
"BankName": "Garanti",
"IsInstallments": false,
"BankLogo": "img/bank/cards-01.png"
}, {
"Installments": [...],
"BankId": 2,
"BankName": "Advantage",
"IsInstallments": false,
"BankLogo": "img/bank/cards-05.png"
}, {
"Installments": [...],
"BankId": 3,
"BankName": "Finansbank",
"IsInstallments": false,
"BankLogo": "img/bank/cards-03.png"
}]
這是HTML標記:
<div id="installments"
class="{{bankValue !== '' ? 'inactive' : '' }}">
<div class="row m0 row-paddless">
<div class="col-xs-4 col-sm-2"
ng-repeat="bank in json" >
<section data-bank-id="{{bank.BankId}}"
class="bank {{bankValue == bank.BankId ? 'active' : 'inactive' }}">
<div style="background-image: url('{{bank.BankLogo}}');" class="img-holder"></div>
<ul>
<li ng-repeat-start="i in [2,3,4,5,6,7,8,9]"
ng-if="bank.Installments[i-2].InstCount !== i || bank.Installments[i-2].InstCount == undefined">
<p>{{i}} TAKSİT</p>
<p>disabled</p>
<p><small>disabled</small></p>
</li>
<li ng-repeat-end="i in [2,3,4,5,6,7,8,9]"
ng-click="clickLi(ins, bank)"
ng-if="bank.Installments[i-2].InstCount == i" class="{{installmentValue == bank.Installments[i-2].InstCount ? 'active' : '' }} {{bank.Installments[i-2].InstRate == 0 ? 'special' : '' }}">
<p>{{bank.Installments[i-2].InstCount}} TAKSİT</p>
<p><span itemprop="price" class="price-value" ng-init="newPrice = price + (price * bank.Installments[i-2].InstRate/100)"> {{ newPrice | number:2 }} TL</span></p>
<p ng-init="installedPrice = ((price + (price * bank.Installments[i-2].InstRate/100))/bank.Installments[i-2].InstCount)"><span><small> {{ installedPrice | number:2 }} TL X {{bank.Installments[i-2].InstCount}} ay</small></span></p>
</li>
</ul>
</section><!-- "bank" -->
</div><!-- "col-xs-4 col-sm-2" -->
</div><!-- "row" -->
</div><!-- installments -->
這是我所得到的(截圖): http://aslanbakan.com/down/bank-error.PNG
這是我想才達到(截圖): http://aslanbakan.com/down/bank-achive.PNG
我不知道我犯了什麼錯誤。
的鏈接,截圖不好。另外,如果你可以提供一個最小的工作例子(JSFiddle,JS Bin等),它將會非常有幫助。 – alesc
修復了ss。並添加了筆.. [codepen鏈接](http://codepen.io/Aslanbakan/pen/PqKGQY) – eomerx