movieDb.Router = Backbone.Router.extend({
routes:{
'': 'landPage',
'home': 'landPage',
'login': 'login',
'signup': 'signup'
},
landPage: function(p){
$('div#homepage').empty();
},
login: function(p){
new loginViews(); // Calls its own model
},
signup: function(p){
new signupViews(); // Calls its own model
}
});
The problem is when coming from signup and calling login, it also calls the previous model requests(signup) resulting to login and signup request at the same time(my models are ajax requests), how can I remove the previously called models everytime I create a new request in my views.
Thanks.