0.0.3 • Published 6 years ago

@toxicable/lite-router v0.0.3

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

@toxicable/lite-router

Just a little Router that uses similar conventions to @angular/router It dosen't support much only basic url Params.

  • no guards
  • no lazyloading
  • no child routes

just a nice and easy flat layout with easy to access param data

However, it only weighs ~10kb

Installation

yarn add @toxicable/lite-router

Import

imports: [
    LiteRouterModule.withRoutes([
      { path: 'home/:name', component: Comp3},
      { path: 'home', component: Comp2 },
      { path: '', component: Comp1},
    ])
]

lr-outlet

<lr-outlet></lr-outlet>

routerLink

<button lrLink="./some-route">Some Route!</button>

or

<a lrLink="./some-route">Some Route!</a>

LiteRouter

constructor(
  private readonly router: LiteRouter
){
  router.params.subscibe(params => console.log(params));
}
0.0.4

6 years ago

0.0.3

6 years ago