Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validations of the input
Message
De
07/09/2017 09:11:18
 
 
Information générale
Forum:
AngularJS
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01653867
Message ID:
01654082
Vues:
38
>I'm getting strange error (500).
>
>My HTML is this
>
>
> sm-code-unique-validator
>                       table-name="items"
>                       column-to-test="barcode"
>                       primary-key="currentItem.itemId"
>                       ng-model-options="{ debounce: { default : 500, blur: 0 }}"
>
>and the code is
>
>
>ngModel.$asyncValidators.smCodeUnique = function (value) {
>                    if (value) {
>                        var codeObject = {
>                            id: $scope.primaryKey, tableName: $scope.tableName,
>                            columnToTest: $scope.columnToTest, code: value
>                        };
>
>                        $log.debug(codeObject);
>                        return services.Item.checkCodeUniqueness(codeObject);
>                    }
>                    else
>                    {
>                        return true;
>                    }
>                };
>
>I am still getting 500 error and also why the code is always firing? I don't need to fire validators if I didn't touch the control.

If your getting a 500 then obviously something is failing on the server - you need to debug that.
Don't know why your directive is firing when there's no change on the control. Maybe you can add something to the directive to determine where the call needs to be made ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform