ngResource causes website to crash

216 Views Asked by At

I have a webapplication using angular.js with ngResource module to use the REST API on the server.

Here's how all the different urls are accessed:

this.getSomething = function () {
    var deferred = $q.defer();
    $resource(myConstants.API_BASE_URL + 'get/something', {}, {
        get: {
            method: 'GET',
            isArray: false,
            cache: false
        }
    }).get({}, function (data) {
        deferred.resolve(data);
    });
    return deferred.promise;
};

I think this is causing my browser tab to crash (tested on other browsers, they crash as well eventually, firefox displays javascript crash error).

Screenshot of the profiler: Profiler screenshot (can't embed images yet :( )

0

There are 0 best solutions below