Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validations of the input
Message
 
 
À
07/09/2017 03:54:22
Information générale
Forum:
AngularJS
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01653867
Message ID:
01654076
Vues:
47
>>and then I tried to debug in VS 2017 but nothing happened at all. My validation code is not firing. Do you see what may be wrong? I did add the js file in the bundle.config.
>
>I see that you've got the directive to fire but what is this returning : return services.Item.checkCodeUniqueness(codeObject);
>Don't forget that this must be promise that will be resolved or rejected.

The Item Service code is this:
/**
     * @public
     * @param {object} 
     * @returns {ng.IPromise} 
     */
    ItemService.prototype.checkCodeUniqueness = function (codeObject) {
        var deferred = services.Deferred;

        services.Http.put(urlPath + '/checkCodeUniqueness', codeObject)
            .then(function (data) {
                if (data.data.isValid) {
                    deferred.resolve(data.data);
                }
                else
                {
                    deferred.reject(data.data.errorMessage);
                }
            });

        return deferred.promise;
    };
I haven't have a chance to test it yet and it is still not clear to me how would I assign returned error message to the error to display. I plan to have a few same directives in that form (I need to test both barcode and UPC)
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