Domanda

my_todo_app.html has

  1. todo_header.html
  2. todo_body.html
  3. todo_footer.html

The htmls above are rendered server-side.

todo_header.html creates HeaderView like below(and the two other htmls create their corresponding Backbone Views as well)

<div id='header-view'>
  .. other html contents that are rendered in server-side
</div>

require([header_view], function(HeaderView) {
  var headerView = new HeaderView({el: "#header-view");
});

Is this bad practice?

I'd like to concatenate javascript files for the todo app using r.js and stuck.
Because r.js concatenates files by looking at the dependancy, and I don't have a file that states todo app depends on HeaderView/BodyView/FooterView.

Should I not separate server-side htmls at all?

È stato utile?

Soluzione

I just pluck out the javascript require call from nested-template.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top