mercredi 21 février 2018

Ember abort - how to prevent from forward transition

I am looking a solution to prevent my forward transition from abort. I just want to prevent the back button ( previous page ) transition after mid of a page. how to do that?

here is my try :

willTransition:function( transition ){

            var target = transition.targetName;

            let previousTransition = this.controllerFor(this.routeName).get('previousTransition.targetName');

            console.log( target, 'previousTransition', previousTransition );

            if(this.get('modelProvider').get('cardTxnPage') === true &&  previousTransition ){
                transition.abort();
            }
        },

In above all are correct. But even I am not able to proceed to next page. means it abort prevents both forward/backward by condition.

any one show me the right approach?




Aucun commentaire:

Enregistrer un commentaire