Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 12th, 2013  |  syntax: None  |  size: 0.69 KB  |  views: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. define(['jquery','underscore','backbone', 'views/manage_pages'], function($, _, Backbone,  ManagePages) {
  2.   var AppRouter = Backbone.Router.extend({
  3.     routes:{
  4.       '/new_page': "showPageForm",
  5.       '/edit_page': "showPageEditForm",
  6.       '*actions': "showPageForm"
  7.     },
  8.   });
  9.   var initialize = function(){
  10.     appRouter = new AppRouter;
  11.     appRouter.on("route:showPageForm", function(){
  12.       console.log('hej');
  13.     });
  14.     appRouter.on("route:showPageEditForm", function(){
  15.       console.log('ho');
  16.     });
  17.     var page_form = new ManagePages();
  18.       Backbone.history.start();
  19.     }
  20.     return {
  21.       initialize: initialize
  22.     }
  23.   });
  24.        
  25. Backbone.history.start({ pushState: true });
clone this paste RAW Paste Data