0
私はバックボーンを使ってアプリケーションの例を作ろうとしていますが、ルータの作業をすることはできません。 は、これは私のルータBackboneJsのルータ
var Workspace = Backbone.Router.extend({
routes:{
"":"mainView",
"event":"event"
},
initialize: function(){
console.log('Hai');
//view = new MainView();
//this.render(view);
//alert(this.routes[Backbone.history.getFragment()]);
},
mainView: function(){
console.log('Load main view');
view = new MainView();
this.render(view);
},
event: function(){
view = new EventView();
this.render(view);
},
render: function(view){
if(this.currentView){
this.currentView.destroy();
}
view.render();
this.currentView = view;
}
});
var router = new Workspace();
https://jsfiddle.net/ypuh8yqv/
あるルータが、私は海があなたがバックボーンの履歴モジュールを開始する必要が
私がpushsStateで使用すると動作しません。pushStateを見てください。ありがとう –
@AngelRomeroHerrera;私はどんなpushStateの質問にもお答えできます。これを答えにすることができれば幸いです。 :) –
私は、ちょうど5分以上が必要ですaha –