Last active
March 11, 2016 15:36
-
-
Save julesbou/e83ef7a8ba71bfb7384f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var router = new Router(); | |
Backbone.history.start(); | |
// Load first view | |
window.location.hash = '#load/0'; | |
// update model of the first view | |
views[0].model.set('name', 'John'); // => name is now: John | |
setTimeout(function() { | |
// Load a second view | |
window.location.hash = '#load/1'; | |
// This is the problem, updating the model of the first view still | |
// triggers a “change” event although the view isn’t present in the DOM anymore | |
views[0].model.set('name', 'Balthazar'); // => name is now: Balthazar | |
}, 2000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment