lundi 28 mars 2016

How to get to error route from locally handling ajax calls

I have an ajax util which is responsible for sending POST and GET request and on the success i always do some calculation and on error i want to be routed to application error route. Here is my code in my controller. I dont fully understand how routing to application error route works.

var error = function (xhr, status, error) {          
               // what to be done here to go to error route 
            };
 var success = function (response) {
                          //my calculation code
                        };

self.ajaxUtil.send(url, 'GET', success, error, JSON.stringify(payload), 'json', 'application/json', true, ajaxHeaderInfo,self.get('store'));




Aucun commentaire:

Enregistrer un commentaire