You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Article.bindAll(scope,'articles',{});Article.findAll({});Article.create({title: "a"},{eagerInject: true}).then(function(){console.log("AFTER",Article.filter());});$timeout(function(){// timeout because the first inject is in a promiseconsole.log("BEFORE",Article.filter());});// log:// BEFORE [Article]// AFTER []
I faked sleep on the server on insert. Seems like the initial object is injected to the list but when HTTP is done it's not there anymore.
The text was updated successfully, but these errors were encountered:
No error but it's not joining the array. The test should also check it's being added to the array:
it('should eager inject',function(){$httpBackend.expectPOST('http://test.angular-cache.com/organization/77/user').respond(200,{organizationId: 77,id: 88});vareagerUser;DS.create('user',{organizationId: 77},{eagerInject: true}).then(function(user){vareagerUserAfterHTTP=DS.filter('user')[0];// currently undefinedassert.isDefined(eagerUserAfterHTTP);assert.equal(user,eagerUserAfterHTTP);assert.equal(user.id,88);assert.isTrue(eagerUser===user);},function(){fail('Should not have succeeded!');});$rootScope.$apply();eagerUser=DS.filter('user')[0];assert.isDefined(eagerUser);assert.equal(eagerUser.organizationId,77);assert.notEqual(eagerUser.id,88);$httpBackend.flush();});
I faked
sleep
on the server on insert. Seems like the initial object is injected to the list but when HTTP is done it's not there anymore.The text was updated successfully, but these errors were encountered: