Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4837

How to show message for an empty model instead of loading in hbs template, each or if

$
0
0

@johnunclesam wrote:

I use very often in my code (and I don't know if I'm right to use it):

{{#each model.posts as |post|}}

  <div>post.title</div>

{{else}}

  <div>I'm loading the posts...</div>

{{/each}}

and until today everything OK.

But now I don't know if the model.posts is empty or not.

How to show an error instead of loading forever an empty array?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4837

Trending Articles