I have a situation where isLoaded on a DS.RecordArray changes to true but the content, length property of the RecordArray is still empty, 0 at that time and only changes later.
Sample Code(coffeescript):
@set('followRequests', App.FollowRequests.find())
...
whenDataLoads: (->
console.log @get('followRequests.isLoaded')
console.log @get('followRequests.length')
@set('content', @get('followRequests').toArray() )
).observes('followRequests.isLoaded')
The first log statement is true while the second is 0 and the template which uses this data is empty. When I see the actual AJAX request I see that the request does return an array of records. And the length and content of the RecordArray do change some time later as seen in the Browser console by doing:
App.Router.myController.get('followRequests').get('length')
---> 12
However this code(below) does populate the content in the template, but it runs 12 times...
whenDataLoads: (->
console.log @get('followRequests.isLoaded')
console.log @get('followRequests.length')
@set('content', @get('followRequests').toArray() )
).observes('followRequests.length')
What's the right way to know when the RecordArray is completely populated...??