Advertisement
Guest User

js

a guest
Mar 5th, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. var movieView = Backbone.View.extend({
  2. template: Handlebars.compile( $("#movie-template").html() ),
  3. initialize: function () {
  4. this.render();
  5. },
  6. render: function () {
  7. this.$el.html(this.template({title:"Welcome to Backbone!"}));
  8. }
  9. });
  10.  
  11. /*
  12. var AppRouter = Backbone.Router.extend({
  13. routes: {
  14. '': 'homeRoute',
  15. 'home': 'homeRoute',
  16. 'about': 'aboutRoute',
  17. },
  18. homeRoute: function () {
  19. var movieView = new movieView();
  20. $("#content").html(movieView.el);
  21. },
  22. aboutRoute: function () {
  23. var aboutView = new AboutView();
  24. $("#content").html(aboutView.el);
  25. }
  26. });
  27.  
  28. var appRouter = new AppRouter();
  29. Backbone.history.start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement