0.0.6 • Published 8 years ago

ng2-router-helper v0.0.6

Weekly downloads
27
License
-
Repository
github
Last release
8 years ago

Installation

Install it from npm:

npm install ng2-router-helper

Usage

Including

Including RouterHelper Service

import {RouterHelper} from "ng2-router-helper";

@Component({
  template: `{{ routerHelper.is('routerName') | async }}`
  providers:[RouterHelper]
})
export class TestComponent {
  constructor(
    private routerHelper: RouterHelper
  ) {}
    
  this.isPartOfRoute$ = this.routerHelper.is('routerName2')
  this.isPartOfRoute$.subscribe(res=>{
    console.log(res)
  })
}
  • is(routePath):Observable<boolean> - Checking if the is the last part of the current URL
  • includes(routePath):Observable<boolean> - Checking if the needed part of the URL matches the

See also

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago