DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • route.pushstate.root
  • / On this page
    • route.pushstate.root

      property

      Configure the base url that will not be modified.

      • source

      String

      Represents the base url that pushstate will prepend to all routes. root defaults to: "/".

      Use

      By default, a route like:

      route(":type/:id")
      

      Matches urls like:

      http://domain.com/contact/5
      

      But sometimes, you only want to match pages within a certain directory. For example, an application that is a filemanager. You might want to specify root and routes like:

      route.pushstate.root = "/filemanager/"
      route("file-:fileId");
      route("folder-:fileId")
      

      Which matches urls like:

      http://domain.com/filemanager/file-34234
      

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.