lundi 21 août 2017

How to watch properties in `router` on change?

In my app, user setting the 6 seperate digits. they can delete/re-enter/enter the values in input. controller sending this values to router.

when router watches all this properties, then it will take user to next page. my question is how to watch the properties ( specified properties ) and react accordingly?

here is my router code ( snippet ):

    export default Ember.Route.extend({

example//
myWatcher(){
console.log('all proeprty available enable next')
},

        setupController(controller,model) {
            this._super(controller, model);
            this.controllerFor('auth-page.credit-card.credit-cardno').set('enableNext', false); 
        },

        otp1:null,
        otp2:null,
        otp3:null,
        otp4:null,
        otp5:null,
        otp6:null,

        actions:{
            setupCardNumber( number, index ){
                this.set('opt'+index, number ); //setting values
                console.log( 'setting', this.get('opt'+index) );//gets properly
            },




Aucun commentaire:

Enregistrer un commentaire