Advertisement
Guest User

Untitled

a guest
Jan 12th, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  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 });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement