mercredi 6 mai 2015

Problems transitioning to route from the controller

I have a controller called application.js in that I have done below code :

setSectionAppForEmailPDF:function(currentCompnay,CurrentProperty,currentSection,currentPage)  

{  
     this.set("currentPage", currentPage);  
     var that = this;  
     this.set('currentSection', currentSection);
     var path = "/" + currentCompnay + "/" +CurrentProperty+"/"+currentSection; // Path == '/trilok/pathak Test/test'
     this.transitionToRoute(path);  //does not call the route ,not working   //this.transitionTo(path);     //does not call the route ,not working
    //this.transitionToRoute('routename', {
    //    queryParams: {
    //        currentCompnay: currentCompnay,
    //        currentProperty: CurrentProperty,
    //        currentSection: currentSection,
    //        currentPage: currentPage
    //    }
    //});                    //does not call the route ,not working

}

Route code ::

App.TestRoute = App.PageBaseRoute.extend  

({   
     model: function() {},  
     setupController: function(controller, model) {  
     controller.set("test", 1);  
     this._super(controller, model); },  
})    

and routing is defined like ::

App.Router.map(function(){  
      this.resource("test",{path:"/:company_id/:property_id/test"});  
    });    

from all defined as well as the commented code i am not able to call the route

can any one tell me that what and where i am going wrong ??




Aucun commentaire:

Enregistrer un commentaire