Created
March 11, 2016 15:38
-
-
Save julesbou/5553facfe88a22fc6889 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
/* .. code for router **/ | |
loadView: function(index) { | |
var view = this.instanciateView(index); | |
this.views.push(view); | |
// unbind all events of the previous view to avoid 'ghost' views | |
if (this.currentView) this.previousView.remove(); | |
$('#app').html(view.render().$el); | |
// store current view | |
this.currentView = view; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment