Skip to content

Digest iterations error #207

Closed
Closed
@mpduffey

Description

@mpduffey

jmdobry -

I have been looking for a lightweight but powerful data caching and model management in Angular. Angular-data appears to have great promise - thanks for the great work. I am struggling to get it working. I have defined a resource 'objectlist' and call the api endpoint at startup from within a service to cache the data. Then, I inject the service into my controller, bind the resource to the controller $scope, and use ng-repeat to create a list in my view. The At some point through all this setup, I get the following error code.

Can you provide any insight on if my setup or use of the module is incorrect?

Thanks,
Mike

app.factory('ObjectList', ['DS', function(DS) {
    return DS.defineResource({
        name: 'objectlist',
        endpoint: '/api/object',
        idAttribute: 'ObjectID'
    });
}])
.service('ObjectService', ['$q', '$filter', '$http', 'ObjectList', 'DS', function($q, $filter, $http, ObjectList, DS) {
    ObjectList.findAll();
}])
.controller('ControllerController', ['$scope', 'ObjectService', 'ObjectList', 'DS', function($scope, ObjectService, ObjectList, DS) {
    DS.bindAll($scope, 'listObjects', 'objectlist', {limit: 50});
}]);
Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations: [["fn: function (){return(new Date).getTime()/100|0}; newVal: 1247592257; oldVal: 1247592256"],["fn: function (){return(new Date).getTime()/100|0}; newVal: 1247592258; oldVal: 1247592257"],["fn: function (){return(new Date).getTime()/100|0}; newVal: 1247592259; oldVal: 1247592258"],["fn: function (){return(new Date).getTime()/100|0}; newVal: 1247592260; oldVal: 1247592259"],["fn: function (){return(new Date).getTime()/100|0}; newVal: 1247592261; oldVal: 1247592260"]] http://errors.angularjs.org/1.2.24/$rootScope/infdig?p0=10&p1=%5B%5B%22fn%3A%20function%20()%7Breturn(new%20Date).getTime()%2F100%7C0%7D%3B%20newVal%3A%201247592257%3B%20oldVal%3A%201247592256%22%5D%2C%5B%22fn%3A%20function%20()%7Breturn(new%20Date).getTime()%2F100%7C0%7D%3B%20newVal%3A%201247592258%3B%20oldVal%3A%201247592257%22%5D%2C%5B%22fn%3A%20function%20()%7Breturn(new%20Date).getTime()%2F100%7C0%7D%3B%20newVal%3A%201247592259%3B%20oldVal%3A%201247592258%22%5D%2C%5B%22fn%3A%20function%20()%7Breturn(new%20Date).getTime()%2F100%7C0%7D%3B%20newVal%3A%201247592260%3B%20oldVal%3A%201247592259%22%5D%2C%5B%22fn%3A%20function%20()%7Breturn(new%20Date).getTime()%2F100%7C0%7D%3B%20newVal%3A%201247592261%3B%20oldVal%3A%201247592260%22%5D%5D minErr/<@http://54.164.166.221/libs/angular/angular.js:78:5 $RootScopeProvider/this.$get</Scope.prototype.$digest@http://54.164.166.221/libs/angular/angular.js:12582:1 $RootScopeProvider/this.$get</Scope.prototype.$apply@http://54.164.166.221/libs/angular/angular.js:12805:13 done@http://54.164.166.221/libs/angular/angular.js:8378:34 completeRequest@http://54.164.166.221/libs/angular/angular.js:8592:7 createHttpBackend/</xhr.onreadystatechange@http://54.164.166.221/libs/angular/angular.js:8535:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions