Skip to content

Initial route not firing #199

@rymohr

Description

@rymohr

It seems if the initial page load (in browser) already contains the local route then the route doesn't fire.

routes =
  '/test': -> debugger

router = new Router(routes)
router.init()

The only way I've found to get the initial route to trigger is with this little hack:

initialRoute = window.location.hash.replace(/^#/, '')
router.setRoute('/')
router.setRoute(initialRoute)

Anyone else experiencing this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions