Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Router

Router class handle whole the router config for single page application. It use Navigo

see

Navigo

Hierarchy

  • Router

Index

Properties

Private configRouters

configRouters: IConfigRouters

Private defaultProps

defaultProps: any

Private element

element: Element

Private hash

hash: string

Private root

root: string

router

router: Navigo

This attribute include the navigo singleton which is possible to access all its methods

see

Navigo API

since

0.3.3

Private useHash

useHash: boolean

Methods

Private build

  • build(configRouters: IRouters[], parentPath?: string): void

Private checkDefault

  • checkDefault(): void

Private checkNotFound

  • checkNotFound(): void

Private checkQuery

  • checkQuery(query: string): string
  • Parameters

    • query: string

    Returns string

Private checkState

  • checkState(query: string): string | object
  • Parameters

    • query: string

    Returns string | object

Private createRootElement

  • createRootElement(): void

go

  • go(path: string, state?: any | null, absolute?: boolean): void
  • It goes to the path indicated

    example

    router.go("http://localhost/example", true)

    see

    Pass object by url

    Parameters

    • path: string

      Path of the route, example: /example

    • Optional state: any | null

      Allow to pass object by url and recover it with lastState state property

    • Optional absolute: boolean

      True allow to pass absolute path

    Returns void

resolve

  • resolve(currentUrl?: string): void
  • It resolves all the routes registered

    since

    0.2.1

    Parameters

    • Optional currentUrl: string

    Returns void

Private setPatch

  • setPatch(route: IRouters, params: object, query: string): void

setRouters

updatePageLinks

  • updatePageLinks(): void
  • It triggers the data-navigo links binding process

    since

    0.2.1

    Returns void

Generated using TypeDoc