{
path: '/catalog/:id/',
componentUrl: './pages/catalog.html',
async: function (routeTo, routeFrom, resolve, reject) {
var router = this;
var app = router.app;
app.preloader.show();
app.request({
url: 'data/products.php',
dataType: 'json',
type: 'get',
crossDomain: true,
headers: { 'Accept': 'application/json; odata=verbose' },
statusCode: {
404: function(xhr) {
console.log('page not found');
}
},
complete: function() {
console.log('complete');
},
success: function(response) {
app.preloader.hide();
resolve(
{
componentUrl: './pages/catalog.html',
},
{
context: {
products: response.d.results,
},
}
);
},
error: function(xhr,status) {
console.log(status);
}
});
}
},
Thisi is my code for routing, but the ajax call return me error parse in status… What’s wrong?