Skip to content

Instantly share code, notes, and snippets.

@luizcanet
Created May 5, 2020 23:17
Show Gist options
  • Save luizcanet/ac7914a2916d4af974a9146acc8ae6c4 to your computer and use it in GitHub Desktop.
Save luizcanet/ac7914a2916d4af974a9146acc8ae6c4 to your computer and use it in GitHub Desktop.
Router Methods
router.addRoute({
path: '/section/:param1/:param2/*',
tagName: 'section-list'
})
// When location is /section/book/50/any-string
// and route path is /section/:param1/:param2/*
let params = router.getParams()
// params will be equal { param1: 'book', param2: '50' }
Router.goTo('/categories') // will change location path to /categories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment