mardi 5 septembre 2017

How to get `params.id` after the model hook in route?

After successfuly my page loads, some point later I would like to redirect to next page with params.id information. what is the correct way to retrive the params any time?

here is my router.js:

export default Ember.Route.extend(Validation, {

  model: function(params) { //where to store?

    if(this.store.hasRecordForId('card-list', params.id)){
        return this.store.peekRecord('card-list', params.id );
      }

  },


  actions:{

    goToNext(){
      return;
      this.transitionTo('cs2i.balance.balanceReview', 12 ); //how to get id?
    },

Any one help me here? Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire