Hello,
I am kind of new to AngularJS, so it can be my fault, but since there is so little info I need to ask for help.
In my application I load a JSON that is pretty huge (~ 10000 products). Load times are horrible without compression, as you can imagine and I decided to use gzip compression.
I compress the json response from my REST service (I use Slim). I load my data async via an angular service. It works fine with the uncompressed response. This is my code:
app.factory('CatalogService',function($http)
{
var productsUrl = 'products/';
var service =
{
async: function ()
{
var promise = $http({method:'GET', url: productsUrl, cache:true}).then(function (result) {
var compressed = result.data;
var decomp = JXG.decompress(compressed);
return decomp;
});
return promise;
}
};
return service;
});
The code itself works and debug inspection shows that the response is decompressed fine back to the original. However my templates does not load anything, and I get "undefined" errors on one of my custom filters that inspects a response element length.
Any help is appreciated.