Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Few questions about directives
Message
 
 
À
06/03/2015 12:51:21
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01615790
Message ID:
01616356
Vues:
45
>>Viv,
>>
>>When you were testing smNumberFormat directive, do you have your test page, etc.?
>>
>>Can you expand that sample plnkr I created?
>>
>>http://plnkr.co/edit/HBmOKTqQ9p4m3PzHNvds?p=preview
>>
>>
>>
>>Thanks in advance.
>>
>>Apparently other people are having similar problem, see https://github.com/angular/angular.js/issues/11157#issuecomment-75706528
>
>Not sure what you're asking here. Are you trying to use your smNumberFormat directive within a ng-repeat ?

Yes. That was the markup:
 <table id="payInvoicesTable" ng-show="payInvoices" class="table table-bordered table-hover table-list">
                <thead data-search:table-header data-table="payInvoicesTable" data-search="search()">
                </thead>
                <tbody>
                    <tr ng-repeat="result in payInvoices" ng-form="payInvoicesRow">
                        <td>
                            <input type="checkbox" ng-model="result.isToBePaid"
                                   ng-change="payChange(result)" />
                        </td>
                        <td>                            
                            <a href=""><span ng-click="loadInvoiceView(result.invoice_No)">{{ result.invoice_No }}</span></a>
                        </td>
                        <td>
                            {{result.descrip}}
                        </td>
                        <td>
                            {{result.dateCreated |date: 'medium'}}
                        </td>
                        <td align="right">
                            <span ng-class="{'negative-amount' : result.invoiceBalance < 0}">{{result.invoiceBalance | currency}}</span>
                        </td>
                        <td>
                            <div class="input-group">
                                <span class="input-group-addon">@Labels.currencySymbol</span>
                                <input type="text" name="payment" ng-model="result.payment" id="payment"
                                       ng-disabled="!result.isToBePaid"
                                       ng-class="{'negative-amount' : result.payment < 0}"
                                       min="0"
                                       class="form-control"
                                       data-sm:number placeholder=" 000.00"
                                       data-sm:number-format data-accuracy="2" />
                                <div class="field-validation-error">
                                    <span ng-show="payInvoicesRow.payment.$error.min">@Messages.onlyPositivePayments</span>
                                </div>
                            </div>
                        </td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="4">@Labels.pageTotal</td>
                        <td><span ng-class="{'negative-amount': total('invoiceBalance') < 0}">{{total('invoiceBalance')|currency}}</span></td>
                        <td>{{total('payment')|currency}}</td>
                    </tr>
                </tfoot>
            </table>
Please note, that I had to switch into input type="text" otherwise I was getting that obscure error someone is also getting. I'm wondering if it's possible to reproduce with the plnkr I started. I don't know how to add these 2 directives although I think I tried removing both directives and only leaving input type="number" and still getting that error.

In the other similar page I don't get that same error, so it's really hard to reproduce.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform