Render a Marionette region after model has been fetched

前端 未结 2 1200
时光说笑
时光说笑 2021-01-03 02:00

I would like to use the approach described by Derick Bailey in \"A Generic Problem Solution\" in this thread to render a view after a model is fetched. I wi

2条回答
  •  佛祖请我去吃肉
    2021-01-03 02:52

    You can wait until the model is sync'd before rendering the view

    
    var myView = new MyView({
      model: myModel
    });
    
    myModel.on("sync", function(){
      myRegion.show(myView);
    });
    
    myModel.fetch();
    

提交回复
热议问题