mardi 3 mai 2016

Preserve form data when transition through pages Ember

I have a register form page, and some links on it, to terms and conditions page. When I click on this terms and conditions link, it opens this other page and when I go back to register page the data I put on the form it is not longer there. My register route looks like this:

import Ember from 'ember';

export default Ember.Route.extend({

    model() {
         return this.store.createRecord('post');
    },
    actions:{
        createPost(post){
            post.save().then(function(){
                 //on success
            },function(message){
                 //on error
            });
        }

    }
});

How can I preserve the data when I go back?




Aucun commentaire:

Enregistrer un commentaire