1

I have a problem. I have a news model in my background application and my Emberjs app. And there are a lot of news posts can be stored, so I have to divide loading them to some pages or whatever. The problem is - I need to always get a full count of not readed news posts. What is the best way to implement such behaviour in my Ember application?

freeze
  • 546
  • 6
  • 16
  • possible duplicate of [Ember pagination full example](http://stackoverflow.com/questions/13008838/ember-pagination-full-example) – givanse Dec 20 '14 at 23:57

1 Answers1

3

If you are using Ember Data, I would take a look at Handling Metadata.

The default JSON deserializer looks for a property named meta which could contain something like "totalUnreadPosts": 10

You could get to the metadata with var metaData = store.metaDataFor('newsPost'); which would allow you to get a count without having to load every post.

Sam Heuck
  • 585
  • 5
  • 15