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

How to reload route after saving data?

$
0
0

I have this preparation/controller.js

action: {
           ad.set('wfnum', i);
           ad.save().then(
           function () {
              return true;
           },
           function () {
              if(ad.get('hasDirtyAttributes')) {
                 ad.rollbackAttributes();
              },
         };

Then in another route named approval/route.js

@task(function* () {
  try {
       let ad = yield this.modelFor('.....').ad;
       let approval = yield this.store.query('approval', {
        'ad': ad.id
       })

      return {
           ad: ad,
           adapproval: adapproval,
         }
      } catch(e) {
        throw (e);
        }
    })

So after i saving the ad in the preparation/controller.js, i navigate to other page which need to called the approval/route.js. The approval/route.js the ad model wouldn’t get the latest data updated unless i refresh the page. So how am i going to refresh the route after i saving the data? I did use refresh / reload but it seems not working

3 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 4870

Trending Articles