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

How do I DRY up this common ember data loader?

$
0
0

@davegoulash wrote:

I often find myself doing sth like this:

  this.controllerFor('application').incrementProperty('saving');
  someModel.save().finally(() => {
    this.controllerFor('application').decrementProperty('saving');
  });

If saving > 0 I can show some kind of loading.. / saving... element.

In non ember apps I often used some global before and after callbacks (can't remember the exact details). What's the best way to tap into sth similar from Ember?

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4827

Trending Articles